My data set looks like this
Name ID
Alice 1
Alice 2
Alice -4
Bob 4
Bob 7
2344 9
2344 10
4I 99
4I 04
What I want it to look like is this:
Name ID
Alice 1
Alice 2
Alice -4
Name ID
Bob 4
Bob 7
Name ID
2344 9
2344 10
Name ID
4I 99
4I 04
Every time the name entry changes, I want to introduce 1 empty rows and a row of my header.
Sub insertingrows()
FinalColumn = Cells(1, Columns.Count).End(xlToLeft).Column
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
For j = 3 To FinalRow
If Cells(j, 2) <> Cells(j - 1, 2) Then
'Rows(j & ":" & j + 2).Insert
Rows(j).Insert
Rows(1).Copy
Rows(j + 1).Insert
FinalRow = FinalRow + 2
j = j + 2
End If
Next j
End Sub
My initial actual data has 3830 rows but even though I am updating my variable FinalRow inside the loop, the loop is still stopping around 3830 and is leaving a lot of the process unfinished. Is this a limitation of For? Should I use some other type of loop?

