Do ..
For...
...
IF x = 2 then exit for
do stuff here
Next
Loop until ?
As long as your logic avoids a continuous loop i.e. you need an exit point for the outer loop. You also need to decide how the outer loop handles (x never = 2).
'Exit For' is the equivalent of continue i.e. jump to the next item in the For...Next iteration and skip remaining code in For Next block for current item.
I added the outer loop as I misunderstood your question thinking that you wanted to re-start the For...Next loop when a condition is met.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.