|
- Sub 置换()
- m = Sheets(1).Cells(65536, 2).End(xlUp).Row
- Set reg = CreateObject("VBSCRIPT.REGEXP")
- With reg
- .Global = True
- .Pattern = "(^| )(\d)(?!\d)"
- For i = 1 To m
- ss = Sheets(1).Cells(i, 2)
- ss = .Replace(ss, "$10$2")
- Sheets(1).Cells(i, 3) = VBA.Replace(ss, " ", ",")
- Next i
- End With
- Set reg = Nothing
- End Sub
复制代码 |
|