excel - For loops with sheet range in declaration -
so making loop fill values in cells on sheet1. upperbound row number on sheet2, , figured slower saving row number variable. in case isn't entirely clear, i'm saying intuition told me
for = 1 sheet2.range("a1048576").end(xlup).row
would slower than
for = 1 lastrow
since loop have keep referencing sheet2. remembered every time debug loop , put breakpoint @ declaration* statement, never stop @ line. figured they'd @ least same amount of time since maybe both temporarily saved. made quick test before asking , surprise, sheet-referencing loop faster other.
does know why be?
*what line called? declaration of loop? conditional statement?
Comments
Post a Comment