Hello, excellians. In range A1 to A45 I've got dates starting from 22-1-2009 til 25-2-2009.
When I try this procedure and I enter a value like 22-2-2009, this date is never found.
Can anybody show me the error in next procedure.
Sub tryout()
Dim myrange As Range
Dim mycell As Range
Dim dSearch As Date
dSearch = Now()
dSearch = InputBox("enter date")
Set myrange = Range("a1:a45")
On Error Resume Next
Set mycell = myrange.Find(what:=dSearch, searchformat:="ddmmyyyy", lookat:=xlWhole)
On Error GoTo 0
If Not mycell Is Nothing Then
MsgBox "ok"
Else
MsgBox "nothing found"
End If
End Sub
Thanks in advance.
When I try this procedure and I enter a value like 22-2-2009, this date is never found.
Can anybody show me the error in next procedure.
Sub tryout()
Dim myrange As Range
Dim mycell As Range
Dim dSearch As Date
dSearch = Now()
dSearch = InputBox("enter date")
Set myrange = Range("a1:a45")
On Error Resume Next
Set mycell = myrange.Find(what:=dSearch, searchformat:="ddmmyyyy", lookat:=xlWhole)
On Error GoTo 0
If Not mycell Is Nothing Then
MsgBox "ok"
Else
MsgBox "nothing found"
End If
End Sub
Thanks in advance.