用VBA正则表达式即可(自定义函数代码如下)
Function feiyong(rng As String)Set reg = CreateObject(“vbscript.regexp”)reg.Global = Truereg.Pattern = “\d+”Set mat = reg.Execute(rng)For Each m In matstrr = strr + Val(m)Nextfeiyong = strrEnd Functionalt+f11,新建模块,将代码写到模块里即可。
首页 >
用VBA正则表达式即可(自定义函数代码如下)
Function feiyong(rng As String)Set reg = CreateObject(“vbscript.regexp”)reg.Global = Truereg.Pattern = “\d+”Set mat = reg.Execute(rng)For Each m In matstrr = strr + Val(m)Nextfeiyong = strrEnd Functionalt+f11,新建模块,将代码写到模块里即可。