View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Matt[_37_] Matt[_37_] is offline
external usenet poster
 
Posts: 4
Default How do I perform a certain function if VBA throws up an error?


IF the below code throws up an error (i.e. lookup_value, a parameter
passed into the sub/function is not contained in the worksheet) THEN
(do something)...

ELSE (do something else)....

END IF

I'm sure its trivial, any help appreciated.



Cells.Find(What:=lookup_value, After:=ActiveCell, LookIn:=xlFormulas,
LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False, SearchFormat:=False).Activate

Many thanks

Matt