I want the macro below to accept any date that I enter in its input
box, e.g. 17/06/2011, and go and find it in the active worksheet. I
got an error message saying, "Object variable or With block variable
not set". Can anyone help me? Thanks.

Sub FindDate()
Dim myDate As Date ' possibly incorrect
myDate = Application.InputBox("What date are you looking for?",
Type:=1)
    Cells.Find(What:="myDate", After:=ActiveCell, LookIn:=xlFormulas,
_
        LookAt:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:=xlNext, _
        MatchCase:=False, SearchFormat:=False).Activate
End Sub

Tom

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to