Excel批量产生批注 的VBA代码

2025-03-23 20:38:05
推荐回答(3个)
回答1:

先选中区域,再执行以下代码:

Sub Add_Comment()
For Each cel In Selection
If Not cel.Comment Is Nothing Then cel.Comment.Delete
cel.AddComment
cel.Comment.Text Text:="20100621:" & cel.Value
Next
End Sub

回答2:

for i=6 to 15
Range("B" & i).AddComment
Range("B" & i).Comment.Text Text:="20100621:" & Cells(i, 2).Value
next i

回答3:

这个简单!!
你直接应用excel的录制宏,然后你手动完成一个。然后可以查看宏代码!根据宏代码修改成你需要的,就ok了