C
Carlos
Hi,
I basically want to run an if function that searches a range to find a
variable. (hopefully not finding it) then it will run the code.
if it does find a match I want it to just post a msgbox.
What code syntax do i need for find nothing.
Sub test ()
S = 10
Worksheets("sheet1").Range("A1:A30").Select
Cells.Find(What:=S, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
If find Is Nothing Then
' run my code
Else
' msgbox.
end if
end sub
Thanks for any help
Carl
I basically want to run an if function that searches a range to find a
variable. (hopefully not finding it) then it will run the code.
if it does find a match I want it to just post a msgbox.
What code syntax do i need for find nothing.
Sub test ()
S = 10
Worksheets("sheet1").Range("A1:A30").Select
Cells.Find(What:=S, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate
If find Is Nothing Then
' run my code
Else
' msgbox.
end if
end sub
Thanks for any help
Carl