✔ 最佳答案
.
Sub AddCom()
'
For i = 2 To [A65536].End(3).Row
If Cells(i, 4) <> "" Then
If Not Cells(i, 4).Comment Is Nothing Then Cells(i, 4).Comment.Delete
Cells(i, 4).AddComment
Cells(i, 4).Comment.Visible = False
Cells(i, 4).Comment.Text Text:=Cells(i, 5).Value
End If
Next
'
End Sub
或
Sub AddCom()
'
For Each c In [D2].Resize([A65536].End(3).Row - 1)
If c <> "" Then
If Not c.Comment Is Nothing Then c.Comment.Delete
c.AddComment
c.Comment.Visible = False
c.Comment.Text Text:=c(1, 2).Value
End If
Next
'
End Sub