标题:excel模糊替换 使用vba中正则表达式替换 函数法 3行-多个连续空格只保留一个

-------------------------------------------------------------------------------------------------------------------------------

时间:2013/8/2 14:02:00

-------------------------------------------------------------------------------------------------------------------------------

内容:

输入

查看更多精彩图片

Function replacereg(raw As String) As String
   With CreateObject("VBSCRIPT.REGEXP")
        .Global = True
        .Pattern = "\s+"
        replacereg = .Replace(raw, Chr(32))
    End With

End Function

输入

查看更多精彩图片

Function replacereg(raw As String) As String
   With CreateObject("VBSCRIPT.REGEXP")
        .Global = True
        .Pattern = "\s+"
        replacereg = .Replace(raw, Chr(32))
    End With

End Function