Thread
:
Continuing a loop from within an if statement?
View Single Post
#
8
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
Continuing a loop from within an if statement?
try
If InStr(Cells(ActiveCell.Row, ActiveCell.Column), "USA") Then MsgBox "Hi"
or for str1
If InStr(str1, "USA") Then dosomething
NO neeed for
else
do something else
end if
IF on same line or you used the continuation character _
--
Don Guillett
SalesAid Software
"Sam" wrote in message
oups.com...
I need to go to the next iteration of my loop from within my IF
statement. How is this done? I can't belive I can't find such a simple
thing on my own...
For i = 1 To lastrow
...do something
If Mid(str1, 1, 3) = "USA" Then
... do something else
Next ///// gives me compile error "next without for"
End If
..do something
Next
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett