Function sumstr(ByVal str As String) As String
Dim dic As Object, reg As Object, macthres As Object, strres As String, i As Long, sub1 As String, sub2 As String
Set dic = CreateObject("scripting.dictionary")
Set reg = CreateObject("vbscript.regexp")
reg.Global = True: reg.Pattern = "([\d\.]*)([a-zA-Z]+)"
For Each macthres In reg.Execute(str)
sub1 = macthres.submatches(0): sub2 = macthres.submatches(1)
If Not dic.exists(sub2) Then
dic.Add sub2, IIf(Val(sub1) = 0, 1, Val(sub1))
Else
dic.item(sub2) = dic.item(sub2) + IIf(Val(sub1) = 0, 1, Val(sub1))
End If
Next
For i = 0 To dic.Count - 1
sumstr = sumstr & dic.items()(i) & dic.keys()(i) & IIf(i = dic.Count - 1, "", ",")
Next
End Function