PDA

View Full Version : Manipulating Excel cell comments in VBA and with DB Data



deyken
01-31-2012, 01:02 AM
Hi Guys,

Is there a way I can programmatically manipulate Excel individual Cell comments with VBA Code? If so, I also want then to be able to put Notes (loaded from an ADO Recordset Field) into such Cells' comments and even sometimes upload data/text in such Cell comments into the database.

Looking forward to your assistance!

mohanvijay
01-31-2012, 04:25 AM
To add comment


Range("a1").AddComment "hai"


To get Comment text



Dim T_Str As String
T_Str = Range("a1").Comment.Text


Note:I f you add comment to particular cell which has already comment that will raise error in such case delete the comment (Range("a1").ClearComments) and add the new comment

Norie
02-01-2012, 03:39 AM
It really depends what you want to do.

You can add to existing comments, extract all the comments from a group of cells and store them somewhere

Both of which, and more, could be combined with ADO to work with external data.