|
Sub kk()
Dim regx As Object, irow As Integer, arr(), dic As Object
Set dic = CreateObject("scripting.dictionary")
Set regx = CreateObject("VBScript.RegExp")
regx.Global = True
regx.Pattern = "([一-龢]+)(\d+)"
With Sheet1
irow = .Cells(Rows.Count, 2).End(3).Row
arr = .Range("b2:c" & irow).Value
For i = 1 To UBound(arr)
For j = 1 To UBound(arr, 2)
Set mat = regx.Execute(arr(1, j))
For Each ma In mat
dic(ma.SubMatches(0)) = dic(ma.SubMatches(0)) + CInt(ma.SubMatches(1))
Next
Next j
For Each k In dic.keys
ss = ss & k & dic(k) & Chr(32)
Next
.Range("e2").Value = ss
Next i
End With
End Sub
|
评分
-
查看全部评分
|