|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
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
|
|