+ Reply to Thread
Results 1 to 10 of 10

Excel worksheet cell comment box

  1. #1
    Donald Stockton
    Guest

    Excel worksheet cell comment box

    ActiveCell.AddComment
    ActiveCell.Comment.Visible = False
    ActiveCell.Comment.Text Text:="This is a Test"


    The above code will add a comment to the active cell, but how can I also
    change the Font properties rather than excel using the default setting?


    D.S.

    *** Sent via Developersdex http://www.developersdex.com ***

  2. #2
    Tom Ogilvy
    Guest

    Re: Excel worksheet cell comment box

    Sub E()
    ActiveCell.AddComment
    ActiveCell.Comment.Visible = False
    ActiveCell.Comment.Text Text:="This is a Test"
    With ActiveCell.Comment.Shape.TextFrame.Characters.Font
    .Name = "Times New Roman"
    .Size = 12
    .Bold = False
    End With

    End Sub

    --
    Regards,
    Tom Ogilvy



    "Donald Stockton" <[email protected]> wrote in message
    news:%[email protected]...
    > ActiveCell.AddComment
    > ActiveCell.Comment.Visible = False
    > ActiveCell.Comment.Text Text:="This is a Test"
    >
    >
    > The above code will add a comment to the active cell, but how can I also
    > change the Font properties rather than excel using the default setting?
    >
    >
    > D.S.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




  3. #3

    Re: Excel worksheet cell comment box

    Hi
    Search this Group using
    "How do I change the font inside a cell comment"

    regards
    Paul


  4. #4
    John
    Guest

    Re: Excel worksheet cell comment box

    Hi Donald,

    Have a go with this.

    Best regards

    John



    Sub DonaldsComment()

    Dim oCmt As Comment

    'Set reference to new comment
    Set oCmt = ActiveCell.AddComment

    'Set visibility & text
    oCmt.Visible = False
    oCmt.Text "This is a test"

    'Set font
    With oCmt.Shape.TextFrame.Characters.Font
    .Name = "Arial"
    .Size = 10
    .Bold = False
    End With

    'Set comment size
    With oCmt.Shape
    .Width = 100
    .Height = 100
    End With

    End Sub




    "Donald Stockton" <[email protected]> wrote in message
    news:%[email protected]...
    > ActiveCell.AddComment
    > ActiveCell.Comment.Visible = False
    > ActiveCell.Comment.Text Text:="This is a Test"
    >
    >
    > The above code will add a comment to the active cell, but how can I also
    > change the Font properties rather than excel using the default setting?
    >
    >
    > D.S.
    >
    > *** Sent via Developersdex http://www.developersdex.com ***




  5. #5
    D.S.
    Guest

    Re: Excel worksheet cell comment box

    Thanks to all


    "John" <[email protected]> wrote in message
    news:[email protected]...
    > Hi Donald,
    >
    > Have a go with this.
    >
    > Best regards
    >
    > John
    >
    >
    >
    > Sub DonaldsComment()
    >
    > Dim oCmt As Comment
    >
    > 'Set reference to new comment
    > Set oCmt = ActiveCell.AddComment
    >
    > 'Set visibility & text
    > oCmt.Visible = False
    > oCmt.Text "This is a test"
    >
    > 'Set font
    > With oCmt.Shape.TextFrame.Characters.Font
    > .Name = "Arial"
    > .Size = 10
    > .Bold = False
    > End With
    >
    > 'Set comment size
    > With oCmt.Shape
    > .Width = 100
    > .Height = 100
    > End With
    >
    > End Sub
    >
    >
    >
    >
    > "Donald Stockton" <[email protected]> wrote in message
    > news:%[email protected]...
    >> ActiveCell.AddComment
    >> ActiveCell.Comment.Visible = False
    >> ActiveCell.Comment.Text Text:="This is a Test"
    >>
    >>
    >> The above code will add a comment to the active cell, but how can I also
    >> change the Font properties rather than excel using the default setting?
    >>
    >>
    >> D.S.
    >>
    >> *** Sent via Developersdex http://www.developersdex.com ***

    >
    >




  6. #6
    D.S.
    Guest

    Re: Excel worksheet cell comment box

    One more question about the comment box....

    Can it be sized? for instance, can I size it to fit the contents?


    "D.S." <[email protected]> wrote in message
    news:[email protected]...
    > Thanks to all
    >
    >
    > "John" <[email protected]> wrote in message
    > news:[email protected]...
    >> Hi Donald,
    >>
    >> Have a go with this.
    >>
    >> Best regards
    >>
    >> John
    >>
    >>
    >>
    >> Sub DonaldsComment()
    >>
    >> Dim oCmt As Comment
    >>
    >> 'Set reference to new comment
    >> Set oCmt = ActiveCell.AddComment
    >>
    >> 'Set visibility & text
    >> oCmt.Visible = False
    >> oCmt.Text "This is a test"
    >>
    >> 'Set font
    >> With oCmt.Shape.TextFrame.Characters.Font
    >> .Name = "Arial"
    >> .Size = 10
    >> .Bold = False
    >> End With
    >>
    >> 'Set comment size
    >> With oCmt.Shape
    >> .Width = 100
    >> .Height = 100
    >> End With
    >>
    >> End Sub
    >>
    >>
    >>
    >>
    >> "Donald Stockton" <[email protected]> wrote in message
    >> news:%[email protected]...
    >>> ActiveCell.AddComment
    >>> ActiveCell.Comment.Visible = False
    >>> ActiveCell.Comment.Text Text:="This is a Test"
    >>>
    >>>
    >>> The above code will add a comment to the active cell, but how can I also
    >>> change the Font properties rather than excel using the default setting?
    >>>
    >>>
    >>> D.S.
    >>>
    >>> *** Sent via Developersdex http://www.developersdex.com ***

    >>
    >>

    >
    >




  7. #7

    Re: Excel worksheet cell comment box

    Hi
    Try searching this group using "can I size a comment box to fit the
    contents"

    regards
    Paul


  8. #8
    Norman Jones
    Guest

    Re: Excel worksheet cell comment box

    Hi Don,

    In addition to Paul's advice see Debra Dalgleish's suggestions at:

    http://www.contextures.com/xlcomments03.html#Resize


    ---
    Regards,
    Norman


    "D.S." <[email protected]> wrote in message
    news:[email protected]...
    > One more question about the comment box....
    >
    > Can it be sized? for instance, can I size it to fit the contents?
    >
    >
    > "D.S." <[email protected]> wrote in message
    > news:[email protected]...
    >> Thanks to all
    >>
    >>
    >> "John" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi Donald,
    >>>
    >>> Have a go with this.
    >>>
    >>> Best regards
    >>>
    >>> John
    >>>
    >>>
    >>>
    >>> Sub DonaldsComment()
    >>>
    >>> Dim oCmt As Comment
    >>>
    >>> 'Set reference to new comment
    >>> Set oCmt = ActiveCell.AddComment
    >>>
    >>> 'Set visibility & text
    >>> oCmt.Visible = False
    >>> oCmt.Text "This is a test"
    >>>
    >>> 'Set font
    >>> With oCmt.Shape.TextFrame.Characters.Font
    >>> .Name = "Arial"
    >>> .Size = 10
    >>> .Bold = False
    >>> End With
    >>>
    >>> 'Set comment size
    >>> With oCmt.Shape
    >>> .Width = 100
    >>> .Height = 100
    >>> End With
    >>>
    >>> End Sub
    >>>
    >>>
    >>>
    >>>
    >>> "Donald Stockton" <[email protected]> wrote in message
    >>> news:%[email protected]...
    >>>> ActiveCell.AddComment
    >>>> ActiveCell.Comment.Visible = False
    >>>> ActiveCell.Comment.Text Text:="This is a Test"
    >>>>
    >>>>
    >>>> The above code will add a comment to the active cell, but how can I
    >>>> also
    >>>> change the Font properties rather than excel using the default setting?
    >>>>
    >>>>
    >>>> D.S.
    >>>>
    >>>> *** Sent via Developersdex http://www.developersdex.com ***
    >>>
    >>>

    >>
    >>

    >
    >




  9. #9
    Registered User
    Join Date
    02-13-2005
    Posts
    64
    With Range("A1")
    .addComment ("This is my sized comment")
    .Comment.Shape.Height = 11
    .Comment.Shape.Width = 123
    End With

  10. #10
    D.S.
    Guest

    Re: Excel worksheet cell comment box

    Thanks to all.. All of your suggestions have been very helpfull.


    "ph8" <[email protected]> wrote in message
    news:[email protected]...
    >
    > With Range("A1")
    > addComment ("This is my sized comment")
    > Comment.Shape.Height = 11
    > Comment.Shape.Width = 123
    > End With
    >
    >
    > --
    > ph8
    > ------------------------------------------------------------------------
    > ph8's Profile:
    > http://www.excelforum.com/member.php...o&userid=19871
    > View this thread: http://www.excelforum.com/showthread...hreadid=513219
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1