Loop whose endpoint (?) change during the loop I have a loop which insert rows on specific cases. The loop goes through ~2000 rows and insert about 500.

Due to the inserted rows it doesn't loop the full range I want. I have solved that problem by counting the number of row I will insert with a first loop and then looping up to LastRow + Counter.

I feel as if there must have been a better way to do it.

Sub AddRows()
Dim i As Integer: i = 8
Dim LastRow As Integer: LastRow = Cells(8, 2).End(xlDown).Row
Dim counter As Integer: counter = 0

For i = 8 To LastRow
    If Cells(i, 1) &lt;&gt; "" Then
        counter = counter + 1
    End If
Next i

NewLastRowAfterAddingRows = LastRow + counter  

For i = 8 To NewLastRowAfterAddingRows 
    If Cells(i, 1) &lt;&gt; "" Then
        Range(i + 1 &amp; ":" &amp; i + 1).Insert CopyOrigin:=xlFormatFromRightOrBelow
        i = i + 1
    End If
Next i


End Sub
It's generally not a good idea to alter the iterator variable in a for/next loop.  While your code works, it's just not a good practice.  Also, your initializing i to 8 is redundant since your loop starts at 8 as well.  Here's how I would handle it:

Sub AddRows()

    Dim i As Integer
    Dim LastRow As Integer
    Dim counter As Integer

    LastRow = Cells(8, 2).End(xlDown).Row
    counter = 8

    For i = counter To LastRow
        If Cells(counter, 1) &lt;&gt; "" Then
            counter = counter + 1
            Range(counter &amp; ":" &amp; counter).Insert CopyOrigin:=xlFormatFromRightOrBelow
        End If
        counter = counter + 1
    Next i

End Sub