Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run-time error '91' on Cells.Find()
Hi,
I recorded a macro to find a date in a worksheet. The generated code looks like this: Range("A2").Select Application.FindFormat.Clear Application.FindFormat.NumberFormat = "dd/mm/yyyy" Application.FindFormat..... .... Cells.Find(What:="20-01-2004", After:=ActiveCell, _ LookIn:=xlValues, LookAt:=xlPart, _ SearchOrder:=xlByRows, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=True).Activate However, when I try to run this macro, I get an error message: Run-time error '91': Object variable or With block variable not set. When I click debug, the error appears to be caused by the Cells.Find() statement. My intension is to create a ThisWorkbook.Open method that finds the current date in the worksheet. What can I do to make this macro work? Any help will be greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
Dynamic chart generation: Run time Error '1004: Method 'Cells' of object'_Global' fai | Charts and Charting in Excel | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
Run-time error 1004: Cannot shift nonblank cells off the worksheet | Excel Discussion (Misc queries) | |||
How do you sum a range of more than 30 cells. I get error each time I try. | Excel Worksheet Functions |