Hi All,

I need to create a loop which runs through the data in column A and inserts a row wherever the data changes (I've already coded a sort on the data so this doesn't have to be particularly dynamic). I've been using the below code which pretty much does what I require, however, I could do with the code also inserting the value from column 'A' in the new blank row. Any suggestions?

Ideally, the code would also then 'group' the rows and collapse, leaving just the list of unique values in column 'A'

Sub InsRow()
Dim LR As Long, i As Long
LR = Range("A" & Rows.Count).End(xlUp).Row
For i = LR To 2 Step -1
    If Range("A" & i).Value <> Range("A" & i - 1).Value Then Rows(i).Resize(1).Insert
Next i
End Sub