I'm after code to add two rows of cells but only 6 columns wide every time a value changes in a columns. e.g.
before;
1
1
1
2
2
3
3
3
3
after;
1
1
1
(insert two rows, 6 columns wide here)
2
2
(insert two rows, 6 columns wide here)
3
3
3
3
(insert two rows, 6 columns wide here)
This is the code i have so far;
Sub InsertBlankRows()
Dim LastRow As Long
Dim i As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = LastRow To 2 Step -1
If i = 2 Then
'Do nothing
ElseIf Cells(i, "A") <> Cells(i - 1, "A") Then
Cells(i, "A").Insert
End If
Next i
End Sub
This code inserts one cell below each of the values when they change but one column only
help would be greatly appreciated.
Bookmarks