• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Shade of Gray Font Color Not Correctly Displaying With Code

Why is it when I run this code the shade of gray color is not what's it's supposed to be? (in Excel it's the shade of gray in the far most bottom left corner of the theme colors).


With Selection.Font

.Name = "Kozuka Gothic Pro L"

.FontStyle = "Bold"

.Size = 20

.ThemeColor = xlThemeColorDark1

.TintAndShade = -0.499984741

.ThemeFont = xlThemeFontNone

End With


I know I can can copy another cell and paste the correctly formatted color over it just fine. But I wanted to avoid .copy and .paste if at all possible.
 
I'm not as familiar with theme colors...perhaps you want to use the ColorIndex instead?


'Pick a number from 1 to 56

ActiveCell.Font.ColorIndex = 20


'Or, if you want to be very specific

ActiveCell.Font.Color = RGB(100,255,0)


The latter is useful when you need to ensure a specific color, as the color index colors can vary from person to person.
 
Back
Top