|
增加标色。。。
- Sub ykcbf() '//2024.7.30
- Set reg = CreateObject("VBScript.Regexp")
- r = Cells(Rows.Count, 2).End(3).Row
- arr = [a1].Resize(r, 8)
- Cells.Interior.ColorIndex = 0
- With reg
- .Pattern = "[一-龢\(、\)]+"
- .Global = True
- .IgnoreCase = True
- For i = 2 To UBound(arr)
- st = arr(i, 8)
- st = Replace(st, "/", " ")
- arr(i, 3) = .Replace(st, "")
- Next
- End With
- [c1].Resize(r, 1) = Application.Index(arr, 0, 3)
- For i = 2 To r
- If Len(Cells(i, 3)) > 20 Then
- Cells(i, 3).Interior.ColorIndex = 6
- End If
- Next
- MsgBox "OK!"
- End Sub
复制代码
|
|