Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Lloyd Alvarez   on Nov 28 In MS Office Category.

  
Question Answered By: Adalia Fischer   on Nov 28

Your statement is rather vague. Do you mean the code  just flat out fails
to run, or do you mean your vlookup  statement doesn't find what you are
looking for?

I would imagine you are referring to your statement as to not finding
anything, in which case, something as simple as a Boolean statement
could work.

Boolean statements are true\false variables.

Dim bFoundIt as Boolean

At some point within your code you could change the variable to true,
i.e.
bFoundIt = True
if what you are looking for is found, otherwise it will remain as false.

Then run an if statement afterwards, such as

If bFoundIt = false then
Do something
End if

Share: 

 
 
Didn't find what you were looking for? Find more on Help with vlookup in vba, how to deal with errors? Or get search suggestion and latest updates.


Tagged: