|
-
Jan 24th, 2005, 09:17 AM
#1
Thread Starter
Addicted Member
Coded Search in Excel 2002 not working
i have the following code in a module:
Code:
Dim StartDate as Date
ActiveSheet.Range("A1").Select
Activesheet.Cells.Find(What:=StartDate, After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
StartDate = 17/01/05 (variable taken from another sheet)
when i manually search the sheet, it finds the above entry, but when i use the code, it fails with 'Object variable or With block variable not set'
i have tried formating the date as dd/mm/yyyy, but still not working. I have a feeling it is to do with formats, but not sure, as it will find a string, just not this date.
I have also tried recording the same search via excel, but it still wont work.
i found this on MSKB: Run Time Error 91
could it be something to do with this?
any ideas?
TIA
Brian
if you fail to plan, you plan to fail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|