Public Sub data()
Dim mydate1 As Date
Dim mydate As Date
mydate = Application.InputBox("introduci la data di inizio nel formato gg/mm/yyyy", Type:=2)
mydate1 = Application.InputBox("introduci la data di fine nel formato gg/mm/yyyy", Type:=2)
Set Rng = Range("A1:A28")
Set foundcell = Rng.Find(what:=mydate)
Set foundcell1 = Rng.Find(what:=mydate1)
For Each cl In Rng
If cl <= foundcell Or foundcell1 >= cl Then
MsgBox " Alla data " & cl.Value & " il dato è " & cl.Offset(0, 1) '.Address
End If
Next
End Sub |