Run-time error '91'

B

bl

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
 
T

Tom Ogilvy

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
 
Top