I could not understand reason behind it, please any budy explain that why use step 2 in that VBA code
check attachment for more detail
I could not understand reason behind it, please any budy explain that why use step 2 in that VBA code
check attachment for more detail
Step is -1.Please Login or Register to view this content.
For example:
Normally, step is +1
(for example For i = 1 to 6)
but you can change it.
If you want step 2, 3, or other you will use: For i = 1 to 6 Step 2
If you want go backwards, as in your case, and go from last row (Range("B65535").End(xlUp).Row) to 2nd row (To 2) then you need to use Step -1
I assume you mean this line of code:
What it's doing is finding the last populated row and then looping through from that number down to 2 in increments of 1.Please Login or Register to view this content.
So in this example the first run of the loop will concentrate on row 58. The next loop will be row 57, then 56 etc until it gets to row 2.
Does that help make sense of it?
BSB
thanks , now my problem is solve , you understand my problem appropriatly, i mistakenly done mistake when asking question
thanks for explanation
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks