|
Sub Comments()
On Error Resume Next
Range("A1").Select
Range("A1").AddComment
With Range("A1").Comment
.Text Text:="VBA代码添加的批注:" & Chr(10) & "加了Chr(10)换行啦" '设置批注内容
.Shape.TextFrame.Characters.Font.Size = 14 '设置字号14
.Shape.TextFrame.Characters.Font.Name = "宋体" '设置字体宋体
.Shape.TextFrame.Characters(1, 5).Font.Color = RGB(255, 97, 3) '设置字体颜色,(1-5),可选项表示只改变前5个字符的颜色
.Shape.TextFrame.Characters(1, 5).Font.Bold = True '设置加粗
.Shape.TextFrame.Characters(1, 5).Font.Italic = True '设置斜体
.Shape.TextFrame.Characters(1, 5).Font.Underline = xlUnderlineStyleDouble '设置双下划线
.Shape.TextFrame.Characters(1, 5).Font.Strikethrough = True '设置删除线
.Shape.Width = 250 '修改批注宽度
.Shape.Height = 150 '修改批注高度
.Visible = True '显示批注
End With
End Sub |
|