A guru here helped me with a macro, but I believe that they might now be on vacation... I'm on a Mac can can't run the script below on the excel file attached... client is yelling at me - hoping someone can run this macro on the file and post it back to me?
The only thing the macro doesn't do automatically is out the combined info in column B in numerical order, i.e.:
COLUMN A............ COLUMN B
A50000..........................4
A50000..........................4
A50000..........................14
A50000..........................92
Becomes:
COLUMN A............ COLUMN B
A50000..........................4, 14, 92
(what happens with the macro as is:
A50000..........................92, 15, 4)
Hoping someone can help me out. This project has killed me.
Sub x()
Dim sData() As String, vInput(), i As Long, n As Long
With Range("A1", Range("B" & Rows.Count).End(xlUp))
vInput = .Value
.ClearContents
End With
ReDim sData(1 To UBound(vInput, 1), 1 To 2)
With CreateObject("Scripting.Dictionary")
For i = 1 To UBound(vInput, 1)
If Not .Exists(vInput(i, 1)) Then
n = n + 1
sData(n, 1) = vInput(i, 1)
sData(n, 2) = vInput(i, 2)
.Add vInput(i, 1), n
ElseIf .Exists(vInput(i, 1)) Then
If InStr(sData(.Item(vInput(i, 1)), 2), vInput(i, 2)) = 0 Then
sData(.Item(vInput(i, 1)), 2) = sData(.Item(vInput(i, 1)), 2) & ", " & vInput(i, 2)
End If
End If
Next i
End With
Range("A1").Resize(n, 2) = sData
End Sub
Bookmarks