Update:= I don't think the code below is what you want.
Looking at your question again I think you want each unique Number in "A" to have its own set of 2 columns to show results from "B & C", is that correct ??????, Please post expected results or attach file.
Try this:-
NB:= This code will delete the unwanted rows.
Sub MG24Nov27
Dim Rng As Range, Dn As Range, n As Long
Dim Q As Variant, nRng As Range
Set Rng = Range(Range("A2"), Range("A" & Rows.Count).End(xlUp))
With CreateObject("scripting.dictionary")
.CompareMode = vbTextCompare
For Each Dn In Rng
If Not .Exists(Dn.Value) Then
.Add Dn.Value, Array(Dn, 3)
Else
Q = .Item(Dn.Value)
If nRng Is Nothing Then
Set nRng = Dn
Else
Set nRng = Union(nRng, Dn)
End If
Q(0).Offset(, Q(1)).Resize(, 2).Value = Dn.Offset(, 1).Resize(, 2).Value
Q(1) = Q(1) + 2
.Item(Dn.Value) = Q
End If
Next
End With
If Not nRng Is Nothing Then nRng.EntireRow.Delete
End Sub
Regards Mick
Bookmarks