This code is somewhat ugly and dirtily put together, but it'll do the trick:
(ASSUMPTIONS:
- Your values start in Cell
B2
and their corresponding IDs start inA2
- Your Summary Table starts in
E2
- You have less than 50 rows to your dataset
Change everything as you need)
Sub CreateSummaryTable()
Dim cl As Range
Dim StartCl As Range
Dim TableRow As Integer
Set StartCl = Range("B2")
TableRow = 2
For Each cl In Range("B2:B50")
If cl.Value <> StartCl.Value Then
Range("E" & TableRow).Value = StartCl.Offset(0, -1).Value
Range("F" & TableRow).Value = cl.Offset(-1, -1).Value
Range("G" & TableRow).Value = StartCl.Value
Set StartCl = cl
TableRow = TableRow + 1
End If
Next
End Sub