newbie: stop a FOR NEXT loop

  • Thread starter Thread starter Mike H
  • Start date Start date
Check out Exit in the online help; it's used for this situation (Exit For)
as well as others (Exit Do, Exit Sub, Exit Function, etc.).
--
HTH -

-Frank Isaacs
Dolphin Technology Corp.
http://vbapro.com
 
Rethink your loop control.

Maybe you should not be using a for next loop - maybe a do while
loop would be better.

Chrissy.
 
for each cell in Range("A1:A200")
if isempty cell then exit for
' code to execute
Next


for i = 1 to 1000
if [test condition] then exit for
' code to execute
Next i
 
Back
Top