I tested it with dates that exist but still got the same error message. You can try it.
Tom On Jul 26, 3:42 pm, "Rajan_Verma" <rajanverma1...@gmail.com> wrote: > If error is coming it means yourdatenot found in that sheet.. > ' On the Top on Module > On Error Goto Err: > > 'Before End sub Statement > Err: > If err.number<>0 then > Msgbox "DateNot Found",vbinformation > endif > > > > -----Original Message----- > From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] > > On Behalf Of Tom > Sent: Tuesday, July 26, 2011 9:45 AM > To: MS EXCEL AND VBA MACROS > Subject: $$Excel-Macros$$ Help withfinddate. > > I want the macro below to accept anydatethat I enter in its input > box, e.g. 17/06/2011, and go andfindit 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 AsDate' possibly incorrect > myDate = Application.InputBox("Whatdateare 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 athttp://www.excel-macros.blogspot.com > 4. Learn VBA Macros athttp://www.quickvba.blogspot.com > 5. Excel Tips and Tricks athttp://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below > linkhttp://www.facebook.com/discussexcel- Hide quoted text - > > - Show quoted text - -- ---------------------------------------------------------------------------------- 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