Try this:-
Results sheet(2).
Sub MG30Jul58
Dim Rng As Range
Dim Dn As Range
Dim Q As Variant
Dim Fd As Boolean
Dim oSpl As Variant
Dim n As Integer
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, Dn(, 2), Dn(, 3), Dn(, 4), Dn(, 5), Dn(, 6))
Else
Q = .Item(Dn.Value)
oSpl = Split(Q(5), ",")
Fd = False
For n = 0 To UBound(oSpl)
If oSpl(n) = Dn(, 6) Then Fd = True: Exit For
Next n
If Fd = False Then Q(5) = Q(5) & "," & Dn(, 6)
.Item(Dn.Value) = Q
End If
Next
Sheets("Sheet2").Range("A1").Resize(.Count, 6) = Application.Index(.items, Evaluate("row(1:" & .Count & ")"), Array(1, 2, 3, 4, 5, 6))
End With
End Sub
Regards Mick
Bookmarks