Results 1 to 2 of 2
  1. #1
    3 Star Lounger MacroAlan's Avatar
    Join Date
    Feb 2003
    Location
    St Louis, Missouri, USA
    Posts
    254
    Thanks
    6
    Thanked 1 Time in 1 Post

    Color Names (VBA/Excel/2003)

    I see in Excel where if I hover over a color in the selector, it shows me a color name. Can I capture those names to use elsewhere?

    This snippet makes a color chart. I want to add the color names to the right.

    <pre>Sub Colorful()
    Dim cRow As Long
    For cRow = 0 To 54
    Range(Cells(cRow + 1, 2), Cells(cRow + 1, 5)). _
    Interior.ColorIndex = cRow
    <font color=red> ' Cells(cRow + 1, 2).Interior.Color.Name '--- Doesn't work</font color=red>
    Cells(cRow + 1, 1) = cRow - 1
    Next
    End Sub</pre>

    Alan

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Color Names (VBA/Excel/2003)

    As far as I know, the color names are not available that way. You'd have to create a translation table between colors and names.

    BTW, the tooltips aren't accurate. You can customize the color palette (Tools | Options..., Color tab). If you change red to green, the tooltip for the Text Color button on the toolbar will still say "Text Color (Red)", at least in Excel 2002.

Posting Permissions

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