In cells A2:A15 I have:

0801
0801
0801
0801
0803
0803
0804
0804
0805
0805
0807
0807
0809
0809

I am trying to insert a row wherever there is a blank. I am using the Step Into and the Local Window. On the 4th iteration, the code enters the IF statement. When I press F8 on the Set statement and the cursor moves to END IF, at this point, the value of "cell" is 0803 on row 7. This is what I am expecting to see at this point. Now press F8 two more times and the cursor lands on the IF statement. At this point however, the value of "cell" is empty on the 6th row.

If cell was on row 7, then the next iteration of the For loop occurs, how is it that cell is jumping back to row 6? I want it to stay on row 7.





 For Each cell In Range("A2:A15")
        If cell.Value <> cell.Offset(1, 0).Value Then
            cell.Offset(1, 0).EntireRow.Insert
            Set cell = cell.End(xlDown)
        End If
    Next cell