addcomment()
for
i
=
1
to
[a65536].end(xlup).row
'循环到a列最后一个有内容的单元格
if
not
cells(i,
"a").comment
is
nothing
then
cells(i,
"a").comment.delete
cells(i,
"a").addcomment
cells(i,
"a").comment.text
text:=cells(i,
"b")
&
cells(i,
"c")
&
cells(i,
"d")
next
end
sub
有问题可以q这个群找我——84253041(注明baidu
zhidao)
Sheets(1).Range("A1").AddComment '给A1添加批注With Sheets(1).Range("A1").Comment
.Text "EvilFarmer:222" &Chr(10) &"" '批准内容
.Visible = True'可见
.Shape.Fill.UserPicture _'批注图片设置
"C:\Users\EvilFarmer\Desktop\adad.jpg"
.Shape.ScaleWidth 1.55, msoFalse, msoScaleFromTopLeft '宽度设置
.Shape.ScaleHeight 2.22, msoFalse, msoScaleFromTopLeft '高度设置
.Shape.IncrementLeft 116.25'位置设置,靠左的距离
.Shape.IncrementTop 102.75 '离顶部的距离
End With
Sub test()If Not Range("A1").Comment Is Nothing Then Range("A1").Comment.Delete
Range("A1").AddComment Text:="你好,这是用VBA添加的批注!"
With Range("A1").Comment
.Shape.TextFrame.Characters.Font.Size = 13 '设置字号13
.Shape.TextFrame.Characters.Font.Name = "黑体" '设置字体黑体
.Visible = True '显示批注
End With
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)