View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How to detect when Find returns nothing?

See Schollar's response in:

http://groups.google.com/group/micro...06311c55e74647



--
Gary's Student


"Ben" wrote:

Hi all

How do I detect when the following code returns nothing, meaning when no
match is found? I need to when no match is found and then take different
action. Please share with me the code syntax to do this? Thanks.

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



Ben


--