[VBA]利用正则表达式创建函数处理字符串

1、去除字符串中的数字

Function aa(sr As Range)
Set reg = CreateObject("vbscript.regexp")
With reg
.Global = True
.Pattern = "\d+"
End With
aa = reg.Replace(sr, "")

End Function

 

posted @ 2017-07-17 22:32  苏苏叶  阅读(1657)  评论(0)    收藏  举报