Daxton A.
08-27-2008, 07:20 AM
Hi, what I am trying to do is build a Cells.Find statement that shows all the written text alphabetized. The problem that has me stuck is if the text that I lookup is not there I get an error msg.
I figured that I would just put this Cells.Find into an IF statement and it would be simple, but it is not working. The statement is as follows:
If Cells.Find(What:=textToBeFound, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate = False Then
MsgBox ("Not Found")
Else
Cells.Find(What:=textToBeFound, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End If
Can I get pointed in the right direction?
I figured that I would just put this Cells.Find into an IF statement and it would be simple, but it is not working. The statement is as follows:
If Cells.Find(What:=textToBeFound, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate = False Then
MsgBox ("Not Found")
Else
Cells.Find(What:=textToBeFound, After:=ActiveCell, LookIn:=xlFormulas, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False _
, SearchFormat:=False).Activate
End If
Can I get pointed in the right direction?