I used this:
Sub Versive()
Dim dict As Object
Set dict = CreateObject("scripting.dictionary")
For r = 1 To Range("A" & Rows.Count).End(xlUp).Row
If Not dict.exists(Trim(Cells(r, 1).Value)) Then
dict.Add Trim(Cells(r, 1).Value), CSng(Trim(Cells(r, 2)))
Else: dict(Trim(Cells(r, 1).Value)) = dict(Trim(Cells(r, 1).Value)) + CSng(Trim(Cells(r, 2)))
End If
Next
'Output in F1:G1 and down
For r = 0 To dict.Count - 1
Cells(r + 1, 6) = dict.Keys()(r)
Cells(r + 1, 7) = dict.Items()(r)
Next
Set dict = Nothing
End Sub
This assumes the data is in two columns. Does the raw data come out that way, or is it single column only?
Bookmarks