View Full Version : for....next
northernstar
10-07-2007, 03:44 PM
hi
is it possible to use 2 for...next statements
for example
for i = 1 to 12
for n = 23 to 33
'enter code here using i and n
next i
next n
tried a couple of ways but no joy
any ideas
thanks in advance
Charlize
10-07-2007, 04:26 PM
I tend to close my loops from the inside to the outside. ie
For I = 1 to 3
For J = 1 to 6
'Do something during J loop
Next J
Next I
johnske
10-07-2007, 04:26 PM
yes, but must be in the form start outer loop, start inner loop, finish inner loop, finish outer loop e.g. i = 1 to 12
for n = 23 to 33
'enter code here using i and n
next n
next i
northernstar
10-07-2007, 10:39 PM
thanks for that will give it a go
thanks again
northernstar
10-07-2007, 10:41 PM
the only trouble i can see is that i need the code to do something with i and n at the same time
will have another look at it then post some code which i have tried
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.