Hi despacos
welcome to the forum,
on the sample...
Sub ptest()
Dim a, b(), i!, n!
With Range("a1", Range("a" & Rows.Count).End(xlUp)).Resize(, 3)
a = .Value
ReDim b(1 To UBound(a, 1), 1 To 3)
With CreateObject("Scripting.Dictionary")
.CompareMode = vbTextCompare
For i = 1 To UBound(a, 1)
If Not .exists(a(i, 1)) Then
n = n + 1
b(n, 1) = a(i, 1)
b(n, 2) = a(i, 2)
.Add a(i, 1), n
End If
b(.Item(a(i, 1)), 3) = b(.Item(a(i, 1)), 3) & IIf(b(.Item(a(i, 1)), 3) <> "", ", ", " ") & a(i, 3)
Next
End With
.ClearContents
End With
Range("a1").Resize(n, 3).Value = b
End Sub
Bookmarks