Here is a method to do as you wish simply by double clicking any cell. This assumes that your data to evaluate is in columns A:C, and you wish to have one line entry for each ID, with column B to contain all data entries, separated by commas. This is a 'run once' event handler. It will only trigger on the first double click.
Copy the following event handler to the clipboard (highlight the entire code, right click inside the highlighted area, and 'Copy'):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, _
Cancel As Boolean)
Dim i, LastRow, tempVar
LastRow = Application.Cells. SpecialCells(xlCellTypeLastCell).Row
Application.ScreenUpdating = False
If Cells(1, "IV").Value = "X" Then
Target.Offset(0, 1).Select
Exit Sub
End If
Range("IU:IW").ClearContents
For i = 1 To LastRow
If Cells(i, "A").Value = Cells(i + 1, "A").Value Then
tempVar = tempVar & Cells(i, "B").Value & ", "
GoTo here
Else
tempVar = tempVar & Cells(i, "B").Value
Range("IU" & Rows.Count).End(xlUp).Offset(1, 0).Value = Cells(i, "A").Value
Range("IV" & Rows.Count).End(xlUp).Offset(1, 0).Value = tempVar
Range("IW" & Rows.Count).End(xlUp).Offset(1, 0).Value = Cells(i, "C").Value
tempVar = ""
End If
here:
Next
Range("A:C").ClearContents
Columns("IU:IW").Select
Selection.Cut Destination:=Columns("A:C")
Columns("B:B").AutoFit
Target.Offset(0, 1).Select
Range("IV1").Value = "X"
Range("IV1").EntireColumn.Hidden = True
End Sub
Select the worksheet containing the data to evaluate and right click the sheet tab at the bottom.
Select 'View Code'.
Paste the event handler into the white editing area to the right (right click inside the area and 'Paste').
Close the VBE (red button w/white 'x' - top right).
Double click any cell to re-sequence the data.
Note: this has been tested a number of times and returns the appropriate result. However, it is always wise to back up one's work to prevent the accidental smoking crater...