Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Basic Error Run Time Error, Type Mismatch Meg Partridge Excel Discussion (Misc queries) 12 September 10th 08 06:10 PM
Dynamic chart generation: Run time Error '1004: Method 'Cells' of object'_Global' fai Ajay_N Charts and Charting in Excel 1 August 15th 06 03:54 AM
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
Run-time error 1004: Cannot shift nonblank cells off the worksheet [email protected] Excel Discussion (Misc queries) 1 April 10th 06 06:13 PM
How do you sum a range of more than 30 cells. I get error each time I try. Joseph Conaghan via OfficeKB.com Excel Worksheet Functions 5 March 21st 05 10:15 PM


All times are GMT +1. The time now is 05:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"