Hello all,
lets consider this:
so at the poinf of first loop (i) the program stops![]()
Please Login or Register to view this content.
so it does not update the for loop (for i) criteria properly, or as i desire.
what would be the solution
Hello all,
lets consider this:
so at the poinf of first loop (i) the program stops![]()
Please Login or Register to view this content.
so it does not update the for loop (for i) criteria properly, or as i desire.
what would be the solution
It doesn't run subsequent iterations of i, because by the time i = i + 1 has run 20 times in your For j loop then i is greater than you've asked it to loop to at the start, so it doesn't need to run any more.
It's not actually clear, to me at least, what it is you're trying to achieve. Perhaps attach a workbook showing what your data looks like before and after and we can help more from there.
BSB
ok, in simplified...
A1 = "A"
A2 = "B"
A3 = "C"
A4 = "D"
so now i wish to loop through those for rows via:
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
and inside each loop i wish to insert extra 10 rows (via loop, not all 10 rows together) bellow the initial "i" and enter the numerical value 1 to 10
so, slightly modified code to udnerstand:
so, you can see that begining of the first loop (i) it sets the criteria (i=1 to 4), but inside the first loop i create another loop which inserts 10 rows and therefore increases the "i" by +10... so after first loop of "i" I have fulfilled the initial criteria for the loop and it wont carry on to do the same under "B" value (which have shifted from row 2 to 11).![]()
Please Login or Register to view this content.
And I need basicaly the program to insert 10 (one by one by another for loop "j") rows after each nonempty cell in column A
Maybe like this?
BSB![]()
Please Login or Register to view this content.
awesome,
thank you
No problem. Happy to help
BSB
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks