|
楼主 |
发表于 2021-2-17 11:15
|
显示全部楼层
- Sub dwds()
- Set reg = CreateObject("vbscript.regexp")
- arr = Array(1, 2, 3, 4, 5, 6, 7, 8, 9)
- brr = Array("一", "二", "三", "四", "五", "六", "七", "八", "九")
- With reg
- .Global = True
- .Pattern = ".*?([\d\w^一-龥一二三四五六七八九十]+)|.+"
- crr = [a1].CurrentRegion
- For x = 1 To UBound(crr)
- Cells(x, 2) = .Replace(crr(x, 1), "$1")
- Next
- End With
- For i = LBound(arr) To UBound(arr)
- [b:b].Replace brr(i), arr(i), lookat:=xlPart
- Next
- End Sub
复制代码
我只会修改在A列基础上面将中文小写一二三四............修改为1234,类似A1:赛罗二班,在B1出来的结果为:赛罗1班,其他要提取拼音为sai/yi/de转换为赛/依/德加上阿拉伯数字,我就不会修改了
|
|