C
chrislooney0
Hi,
I wonder if anyone can explain the following. When I have a very
simple for next loop, for example:
for i=1 to worksheets.count
sheets(i).select
activesheet.name="a" & i
next i
the first time the macro goes through the loop, when you would expect
the value of i to be 1, the value of i is the highest value, i.e.
worksheets.count.
By the way, it does not seem to be consistent. If I stop and restart
the macro, it seems to go through the loop correctly i.e with i
starting from 1.
Can anybody explain how this works to me?
Thanks!
I wonder if anyone can explain the following. When I have a very
simple for next loop, for example:
for i=1 to worksheets.count
sheets(i).select
activesheet.name="a" & i
next i
the first time the macro goes through the loop, when you would expect
the value of i to be 1, the value of i is the highest value, i.e.
worksheets.count.
By the way, it does not seem to be consistent. If I stop and restart
the macro, it seems to go through the loop correctly i.e with i
starting from 1.
Can anybody explain how this works to me?
Thanks!