Run-time error '91'

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
thanks a lot for answering. I think I got the idea and I'll fix the problem

Rgds
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top