Thread: Error Trapping
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rafi Rafi is offline
external usenet poster
 
Posts: 27
Default Error Trapping

How do I generate an error message such as "Macro will be aborted - The Find
Function cannot return a valid value" if the string "Cross" is not found in
the selection.

Selection.Find(What:="Cross", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

Thanks