As far as I know you can not alter the End loop number once you are inside the for loop
You could use a do - loop or use a For loop stepping backwards
This is how I would do it
![]()
Sub ffff() Dim iLoop As Integer Dim iEndOfLoop As Integer iEndOfLoop = Cells(Rows.Count, "a").End(xlUp).Row For iLoop = iEndOfLoop To 1 Step -1 If Cells(iLoop, 1) = 1 Then Rows(iLoop + 1).Insert Shift:=xlDown End If Next iLoop End Sub
Bookmarks