|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 按钮1_Click()
Set d = CreateObject("scripting.dictionary")
arr = [a1].CurrentRegion
For j = 1 To UBound(arr)
If Len(arr(j, 1)) > 0 Then d(arr(j, 1)) = j
Next j
Application.ScreenUpdating = False
With CreateObject("vbscript.regexp")
.Global = True
.Pattern = Join(d.keys, "|")
For j = 1 To UBound(arr)
For i = 1 To UBound(arr, 2)
For Each m In .Execute(arr(j, i))
Cells(j, i).Characters(m.firstindex + 1, Len(m)).Font.ColorIndex = 3
Cells(d(m.Value), 1).Font.ColorIndex = 3
Next m
Next i
Next j
End With
Application.ScreenUpdating = True
End Sub
|
|