EXCEL函数提取字符串中的数字

来源:百度知道 编辑:UC知道 时间:2024/05/18 03:34:15
求救:
请问:我要在“广东汕尾某街231号”中提取出231怎么输入函数?

有个自定义函数,不知道你会用不?

Function 求数字(对象 As String) '在文本与数字混杂中提取数字
Dim myReg
Set myReg = CreateObject("vbscript.Regexp")
myReg.Global = True
myReg.Pattern = "[^\d/+]"
求数字 = myReg.Replace(对象, "")
Set myReg = Nothing
End Function

用正则表达式提取数字吧,然后用转换函数就可以了