步骤一、首先打开一个EXCEL程序。
步骤二、然后打开VBA编程的界面。
步骤三、定义一个函数。
步骤四、然后使用“rem+空格+注释内容”。
步骤五、用英文字符的上单引号“注释内容”。
步骤六、然后“rem+空格+注释内容”。
步骤七、最后对于幅值对象进行的赋值。
Sub test()s = Timer
Range("A1:D50").ClearComments '清除A1:D50所有批注
With [a1] '设置A1单元格的批注
.ClearComments
.AddComment Text:="Comment"
.Comment.Visible = False
With .Comment.Shape
With .TextFrame.Characters.Font
.Name = "微软雅黑"
.Size = 12
.ColorIndex = 2
End With
.Fill.ForeColor.SchemeColor = 41
.Line.Visible = msoFalse
End With
.Copy '复制A1单元格
End With
Range("A1:D50").PasteSpecial xlPasteComments '选择性粘贴,只粘贴批注
Dim c As Range
For Each c In Range("A1:D50") '设置A1:D50中的每个单元格的批注
With c
.Comment.Text .Address
End With
Next c
Application.CutCopyMode = False
MsgBox "耗时" & (Timer - s) & "秒"
End Sub
在A1单元格里设置好批注,然后复制A1单元格,在区域A1:D50用Excel的选择性粘贴来复制批注。然后根据需要逐个修改该批注。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)