|
Sub 提取数字()
Set regx = CreateObject("vbscript.regexp")
With regx
.Global = True
.Pattern = "\D"
For Each Rng In [a1:a4]
Cells(Rng.Row, 2) = .Replace(Rng, "")
Next
End With
End Sub
Sub 提取字符()
Set regx = CreateObject("vbscript.regexp")
With regx
.Global = True
.Pattern = "\w"
For Each Rng In [a1:a4]
Cells(Rng.Row, 2) = .Replace(Rng, "")
Next
End With
End Sub
Sub 规范格式()
Set regx = CreateObject("vbscript.regexp")
With regx
.Global = True
.Pattern = "\s"
For Each Rng In [a1:a4]
Cells(Rng.Row, 2) = .Replace(Rng, "-")
Next
End With
End Sub
|
|