返回一个
Comment 对象,该对象代表下一条批注。
语法
表达式.Next
表达式 一个返回 Comment 对象的表达式。
返回值
Comment
说明
本方法仅对单张工作表有效。对工作表中最后一条批注使用本方法可返回 Null(不是下一张工作表的第一条批注)。
示例
本示例隐藏下一条批注。
注释 |
请在不带现有批注的新工作簿中进行测试。若要清除工作簿中的所有批注,请在即时窗格中使用
Selection.SpecialCells(xlCellTypeComments).delete 。 |
示例代码 |
//Sets up the comments
for(let xNum = 1;xNum <= 10;xNum++) {
Range("A" + xNum).AddComment()
Range("A" + xNum).Comment.Text("Comment " + xNum)
}
MsgBox("Comments created... A1:A10")
//Deletes every second comment in the A1:A10 range
for(let yNum = 1;yNum <= 10;yNum = yNum + 2) {
Range("A" + yNum).Comment.Next().Shape.Select(true)
Selection.Delete()
}
MsgBox("Deleted every second comment")
|