Nested For Next

O

Owen

Hello

If i have nested For...Next statements, for example

For j = 26 To 30
For k = 11 To 15
For l = 1 To 5
'Code inserted here
Next l
Next k
Next j

Does the first pass set j=26, k=11, l=1
and the second pass set j=26, k=11, l=2

How could i make it so that j,k,l all increment by 1 during the scond pass
through the code? For example,

The first pass set j=26, k=11, l=1
and the second pass set j=27, k=12, l=2

Best Regards
 
O

Owen

Managed to resolve this one, i'll post my method for anyone who may find it
useful.

j = 26
k = 11
l = 1
For z = 1 To 5
'Code
j = j + 1
k = k + 1
l = l + 1
Next z
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top