vba 运行后“要求对象”,什么意思? 5
SubinsertComment()DimobjCMAsET.CommentDimobjRangeAsET.RangeDimobjSheetAsET.WorksheetS...
Sub insertComment()
Dim objCM As ET.Comment
Dim objRange As ET.Range
Dim objSheet As ET.Worksheet
Set objSheet = ETApp.ActiveSheet
Set objRange = objSheet.Cells.Item(4, 4)
objRange.AddComment "this is a comment"
End Sub
就是这个程序,在(4,4)单元格内插入批注,但是运行后显示“424,要求对象”。这是什么意思呢? 展开
Dim objCM As ET.Comment
Dim objRange As ET.Range
Dim objSheet As ET.Worksheet
Set objSheet = ETApp.ActiveSheet
Set objRange = objSheet.Cells.Item(4, 4)
objRange.AddComment "this is a comment"
End Sub
就是这个程序,在(4,4)单元格内插入批注,但是运行后显示“424,要求对象”。这是什么意思呢? 展开
展开全部
你要的功能,我如下代码可以实现:
Sub insertComment()
Dim i, j As Integer
i = 4 '//第4行
j = 4 '//第4列
ActiveSheet.Cells(i, j).Select
ActiveSheet.Cells(i, j).AddComment
ActiveSheet.Cells(i, j).Comment.Visible = False
ActiveSheet.Cells(i, j).Comment.Text Text:="abc123000" '插入批注值abc123000
ActiveSheet.Cells(i, j).Select
ActiveWorkbook.Save '保存
End Sub
Sub insertComment()
Dim i, j As Integer
i = 4 '//第4行
j = 4 '//第4列
ActiveSheet.Cells(i, j).Select
ActiveSheet.Cells(i, j).AddComment
ActiveSheet.Cells(i, j).Comment.Visible = False
ActiveSheet.Cells(i, j).Comment.Text Text:="abc123000" '插入批注值abc123000
ActiveSheet.Cells(i, j).Select
ActiveWorkbook.Save '保存
End Sub
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询