View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
bl bl is offline
external usenet poster
 
Posts: 7
Default Run-time error '91'

thanks a lot for answering. I think I got the idea and I'll fix the problem

Rgds

"Tom Ogilvy" wrote:

if you do

cells.find("value").Select

and value is not found, you will get that error. A better approach is

set rng = cells.find("Value")
if not rng is nothing then
rng.select
else
msgbox "Value not found"
End if

--
Regards,
Tom Ogilvy

"bl" wrote in message
...
Hi there!

Please help me on the following matter. I want to use FIND in order to
identify if the text from one cell exists in another spreadsheet. The fact

is
that I want to test not just one cell, but let's say 300 cells. The code I
made runs until one value is not found in the lookup spreadsheet. The

message
I receive is "object variable or With block variable not set". It is

Run-time
error '91'.

So, if you have any idea how to avoid this message, please let me know...

Thanking in advance

BL