Excel 求助:用VBA从字符串中提取数字

如题所述

温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-09-01

给一个自定义函数:

Function tiqu(rg As String) '提取数字
    
    Set regx = CreateObject("VBScript.RegExp")
    With regx
        .Global = True
        .Pattern = "\D" '数字
    tiqu = .Replace(rg, "")
End With
End Function

本回答被网友采纳
相似回答