PDA

View Full Version : Solved: Editing Cell Comments Via VBA



Bopo2
11-07-2009, 06:42 PM
Hey guys

Well basically I'm creating cell comments by VBA via:


Worksheets("Data").Range("P11").AddComment ("woot")

However I can't find ANY method of editing the comment text via VBA, all I get are constant (pun not indended) errors. I'm really starting to dislike VBA in office packages, it seems every task that is plausible to me, is totally in-plausible to VBA, despite it being so trivial from a logical point on view.

mbarron
11-07-2009, 08:14 PM
To edit the text of your comment, using the cell reference you've used in your example.

Worksheets("Data").Range("P11").AddComment ("woot")
would be:
Worksheets("Data").Range("P11").Comment.Text ("woot part two")

mdmackillop
11-08-2009, 04:21 AM
Sub EditComment()
Dim Txt As String
Txt = InputBox("Edit comment", "Comment Editor", ActiveCell.Comment.Text)
ActiveCell.Comment.Text (Txt)
End Sub