Hi all
I'm having some trouble with a FOR.....NEXT loop that I've written. The code works fine at the moment but what I want to do is put an IF statement in, so that if true will move on to the NEXT without running the rest of the code within the loop.
A simplified version of what I'm trying to do is
FOR i = 1 to 100
code to assign a value to VAR1
code to assign a value to VAR2
more code
more code
IF VAR1 = 1 and VAR2 = 1 then next
more code
more code
NEXT
When I run this I keep getting a 'Next without For' error, what is the correct way to write the IF statement to do what I want
Thanks
Jim
I'm having some trouble with a FOR.....NEXT loop that I've written. The code works fine at the moment but what I want to do is put an IF statement in, so that if true will move on to the NEXT without running the rest of the code within the loop.
A simplified version of what I'm trying to do is
FOR i = 1 to 100
code to assign a value to VAR1
code to assign a value to VAR2
more code
more code
IF VAR1 = 1 and VAR2 = 1 then next
more code
more code
NEXT
When I run this I keep getting a 'Next without For' error, what is the correct way to write the IF statement to do what I want
Thanks
Jim