I am doing a For Each loop through a set of rows. And I am copying those rows a different set of times. For instance, row 2 will be copied 3 times but row 3 is not gonna be copied and row 4 is gonna be copied 2 times.
This number of copied rows is set by a field in the excel - totalDS
The problem is, when I insert this code
Set RowRange = sh.Range("A2:A" & LastRow)
For Each rowiter In RowRange
Dim i As Integer
For i = 2 To totalDS
With Worksheets("Sheet1")
.Rows(rowiter.Row).Copy
.Rows(rowiter.Row).Offset(1).Insert Shift:=xlDown
Application.CutCopyMode = False
End With
Next i
Next rowiter
I will have a row right next to the one I copied and that is correct. But i need that my next step of the For loop goes to the next uncopied row. As it is right now, the For loop will just go for the next line so it will keep copying the same line over and over.
Any tips on this?