jump into the loop

G

Guest

Is it possible to jump into the loop ?

I have the module with two nested For ... Next loops:

For i = 1 to 6
....
For j = 1 to 10
...
Next j
Next i

Is it possible to store the values of i and j, close workbook and on reopen
jump inside the second loop to the place when it was finished, i.e. with i =
3 and j = 7 and to continue what was interupted before closing ? I think it
is not possible, when next is reached before seeing For first it is giving
error message, but maybe I am wrong, maybe it can be done ????

Regards,

Tony
 
P

Peter T

iFrom = 3
jFrom = 7

For i = iFrom To 6

For j = jFrom To 10

Next j
Next i

Regards,
Peter T
 
G

Guest

Don't forget to reset jFrom to 1 after the initial loop:

iFrom = 3
jFrom = 7

For i = iFrom To 6

For j = jFrom To 10

Next j

jFrom = 1

Next i
 

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