|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
参与一下。。。
- Sub ykcbf() '//2024.3.28
- Set reg = CreateObject("VBScript.Regexp")
- With Worksheets("4")
- r = .Cells(Rows.Count, 4).End(3).Row
- arr = .[d1].Resize(r, 2)
- ReDim brr(1 To UBound(arr), 1 To 4)
- With reg
- .Global = True
- .Pattern = "[一-龢]+"
- For i = 2 To UBound(arr)
- b = Split(arr(i, 1))
- m = m + 1
- s = b(1)
- Set mh = .Execute(s)
- brr(m, 1) = b(0)
- brr(m, 2) = mh(0).Value
- brr(m, 3) = .Replace(s, "")
- brr(m, 4) = arr(i, 2)
- Next
- End With
- .Columns("M:N").NumberFormatLocal = "@"
- .Range("k12").Resize(UBound(brr), UBound(brr, 2)) = brr
- End With
- MsgBox "OK!"
- End Sub
复制代码
|
|