Consulting

Results 1 to 3 of 3

Thread: Manipulating Excel cell comments in VBA and with DB Data

  1. #1
    VBAX Regular
    Joined
    May 2009
    Location
    Johannesburg
    Posts
    69
    Location

    Manipulating Excel cell comments in VBA and with DB Data

    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!
    Deyken
    DeezineTek
    South Africa

  2. #2
    VBAX Tutor mohanvijay's Avatar
    Joined
    Aug 2010
    Location
    MADURAI
    Posts
    268
    Location
    To add comment

    [vba]
    Range("a1").AddComment "hai"
    [/vba]

    To get Comment text

    [vba]

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

    [/vba]
    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

  3. #3
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •