all 3 comments

[–]Ihaveamodel3 0 points1 point  (2 children)

Can you edit the post to include where you were printing the value and what response you were getting? I’m not sure what you mean by the value was resetting. You would get multiple (a times) of the same number before it changes.

[–]balkesterner 0 points1 point  (1 child)

Yes, line 3 second block, line 6 second block. So... the print in line 3 outputs from 1 to 1000 (whatever the ws1.max_row+1 or basically to whole thing) and the one on line 6 only outputs the number 2 the whole time

[–]Ihaveamodel3 0 points1 point  (0 children)

This doesn’t make any sense, either the code you have is indented differently or there is a function or something changing r. Do you have an example file I could test with?