|
Sub HasComment()
With Sheet1
ar = .[a1].CurrentRegion
For i = 3 To UBound(ar)
For j = 1 To UBound(ar, 2)
If Not .Cells(i, j).Comment Is Nothing Then
With .Cells(i, j).Comment
If InStr(.Text, "有") > 0 Then
ks = InStr(.Text, "有")
.Shape.TextFrame.Characters(ks, 1).Font.Color = RGB(255, 97, 3) '设置字体颜色
.Shape.TextFrame.Characters(ks, 1).Font.Bold = True '设置加粗
End If
If InStr(.Text, "【") > 0 Then
ks = InStr(.Text, "【")
.Shape.TextFrame.Characters(ks, 1).Font.Color = vbRed ' RGB(255, 97, 3) '设置字体颜色
.Shape.TextFrame.Characters(ks, 1).Font.Bold = True '设置加粗
End If
If InStr(.Text, "】") > 0 Then
ks = InStr(.Text, "】")
.Shape.TextFrame.Characters(ks, 1).Font.Color = vbRed ' RGB(255, 97, 3) '设置字体颜色
.Shape.TextFrame.Characters(ks, 1).Font.Bold = True '设置加粗
End If
If InStr(.Text, "冰箱") > 0 Then
ks = InStr(.Text, "冰箱")
.Shape.TextFrame.Characters(ks, 2).Font.ColorIndex = 7 ' RGB(255, 97, 3) '设置字体颜色
.Shape.TextFrame.Characters(ks, 2).Font.Bold = True '设置加粗
End If
End With
End If
Next j
Next i
End With
MsgBox "ok!"
End Sub
|
|