Help with For..Next Loop

  • Thread starter Thread starter Dewey
  • Start date Start date
D

Dewey

Hi,

I have a For Next loop that I want to skip to the next iteration given
a certain condition, does anyone know the syntax for this.

psuedo code:

For i = 1 to 2000

code...

if condition is true
"Code to loop to next i"
end if

more code...

next i 'normal loop point.


Any help would be greatly appreciated, Cheers

Dewey
 
For i = 1 To 2000

' Code

If '###Condition###' = 1 Then GoTo Nxtloop

' More Code processed if ###Condition### = 0

End If
Nxtloop:
Next
 
Just increment the index by 1 on that condition.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Thanks Dave, thats exactly what I was looking for. I knew there had to
be a syntax for it.

Cheers
 
Back
Top