Results 1 to 2 of 2

How to set comment font size and color in VBA

This is a discussion on How to set comment font size and color in VBA within the Excel Questions forums, part of the Question Forums category; Hi, I used record to generate a VBA Macro to set the comment font size and color. When the Macro ...

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Michigan, USA
    Posts
    17

    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,195

    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
    (My other life: http://damonostrander.com )

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