View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Runtime error using Cell.Find command

Hi Ellen,

Try replacing

Cells.Find(What:="11/11/2007").Activate



with

On Error Resume Next
ActiveSheet.Cells.Find(What:="11/11/2007").Activate
On Error GoTo 0


---
Regards,
Norman


"EllenM" wrote in message
...
Hello,
I have designed a spreadsheet with 24 worksheets. I am trying to design a
macro that will search for a specific date that is embedded inside one of
my
worksheets within the workbook. When I run the script below, the
Cells.Find
command stalls the macro. Specifically I get the following error ---
Runtime
error '91': Object variable or with block not set. How do you suggest I
fix
this?


Sub test()
Worksheets("LeaveRecord").Activate
ActiveSheet.Next.Select
Cells.Find(What:="11/11/2007").Activate

End Sub

Thanks in advance for your help,
Ellen