- 按ALT+F11打开VB编辑器;
-
按F7弹出代码窗口;
F7 - 复制以下代码,粘贴到sheet1并保存:
Sub AAA()
Dim R As Range, L As Long, S As String
Application.ScreenUpdating = False
S = "预警" '修改成你要标记的字符
L = Len(S)
For Each R In Selection
If InStr(R, S) > 0 Then R.Characters(InStr(R, S), L).Font.Color = vbRed
Next
Application.ScreenUpdating = True
End Sub
保存
-
关闭VB代码编辑窗口,在表格中选取目标区域,按ALT+F8 选择对应的宏。
ALT+F8
网友评论