VBA代码:
Sub test()
Dim reg As Object
Dim mat, m, st
Dim rg As Range
Set reg = CreateObject("VBScript.RegExp")
For Each rg In Range("a1:a" & [a65536].End(xlUp).Row)
With reg
.Global = True
.Pattern = "\d+"
Set mat = .Execute(rg)
For Each m In mat
st = st + Val(m)
Next m
rg.Offset(, 1) = st
st = 0
End With
Next
End Sub
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。