How to set comment font size and color in VBA

Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: How to set comment font size and color in VBA

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi,

    I used record to generate a VBA Macro to set the comment font size and color. When the Macro was generated, nothing shows up in Macro.

    Could you help me to generate a code in VBA to set the comment font size and color?

    Thank you very much.

    ssunchen

  2. #2
    MrExcel MVP Damon Ostrander's Avatar
    Join Date
    Feb 2002
    Location
    Denver, Colorado USA
    Posts
    4,240
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi ssunchen,

    Here is a sample macro that sets the font size, color and name of all comments residing in the selected cell or cells.

    Sub SetCommentsProperties()
    Dim Cell As Range
    For Each Cell In Selection
    If Not Cell.Comment Is Nothing Then
    With Cell.Comment.Shape.TextFrame.Characters.Font
    .ColorIndex = 3
    .Size = 12
    .Name = "Arial Black"
    End With
    End If
    Next Cell
    End Sub

    Keep Excelling.

    Damon

    VBAexpert Excel Consulting
    LinkedIn Profile http://www.linkedin.com/pub/damon-ostrander/7/79/a93
    AllExperts Profile http://www.allexperts.com/ep/1059-30...-Ostrander.htm

  3. #3
    Board Regular
    Join Date
    Oct 2016
    Location
    United States
    Posts
    71
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: How to set comment font size and color in VBA

      
    That is what I need. Thanks.
    Last edited by dachickenMind; Oct 29th, 2016 at 05:00 PM.
    I am doing this for myself

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com