在这里,我对你的问题的方法:
Public Sub addComment()
Dim row As Integer
Dim oldComment As String
'Set start row
row = 1
With Sheets("sheetname")
'Do until "A" cell is blank
Do While .Range("A" & row) <> ""
'If "B" cell is not blank
If .Range("B" & row) <> "" Then
'If "A" has no comment, set "" to oldComment
If .Range("A" & row).Comment Is Nothing Then
oldComment = ""
'Else comment is exist
Else
'Store that comment to oldComment
oldComment = .Range("A" & row).Comment.Text & " "
'Delete comment from cell
.Range("A" & row).Comment.Delete
End If
'Insert comment for "A" with old if exist
.Range("A" & row).addComment (oldComment & .Range("B" & row).Value)
End If
'Increase row
row = row + 1
Loop
End With
End Sub
你不必[包括在你的标题“标签”(http://meta.stackexchange.com/questions/19190/should- questions-include-tags-in-their-titles)另请参阅[帮助中心](http://stackoverflow.com/help/tagging) – 0m3r
您是如何试图调整代码的?也许你可以问一个关于当你试图解决它时遇到的问题的更有针对性的问题。 –