44
votes

I've got some cells that I have Conditionally Formatted to Excel's standard 'Bad' Style (Dark red text, light red fill).

In another column I have cells that I have created a Conditional Formatting formula for. I also want to code these to match the 'Bad' Style, but there isn't an option to use the pre-defined dark red text, light red fill. Instead I have to select my own formatting, but I can't find the correct Light/Dark red combination.

Does anyone know the RGB codes for at least the more common of the Conditional Formats?

  • 'Good'
  • 'Bad'
  • 'Neutral'
6

6 Answers

84
votes

For 'Bad' red:

  • The Font Is: (156,0,6)
  • The Background Is: (255,199,206)

For 'Good' green:

  • The Font Is: (0,97,0)
  • The Background Is: (198,239,206)

For 'Neutral' yellow:

  • The Font Is: (156,101,0)
  • The Background Is: (255,235,156)
8
votes

I imagine that these might possibly be changed with some styling options. But as far as default values go, these are taken from my version of Excel 2010 which should have the defaults.

"Bad" Red Font: 156, 0, 6; Fill: 255, 199, 206

"Good" Green Font: 0, 97, 0; Fill: 198, 239, 206

"Neutral" Yellow Font: 156, 101, 0; Fill: 255, 235, 156

5
votes

For anyone who stumbles across this in the future, this is how you do it:

xl.Range("A1:A1").Style := "Bad"
xl.Range("A1:A1").Style := "Good"
xl.Range("A1:A1").Style := "Neutral"

An easy way to check on things like this is to open excel and record a macro. In this case I recorded a macro where I just formatted the cell to "Bad". Once you've recorded the macro, just go in and edit it and it will essentially give you the code. It will require a little translation on your part, but here is what the macro looks like when I edit it:

 Selection.Style = "Bad"

As you can see, it's pretty easy to make the jump to AHK from what excel provides.

1
votes

The easiest way to do this is to format a cell the way you want it, then use the "cell format ..." contextual menu to get to the fill and format colours, use the "more colors ..." button to get to the hexagon colour selector, select the custom tab.

The RGB colours are as in the table at the bottom of the pane. If you prefer HSL values change the color model from RGB to HSL. I have used this to change the saturation on my bad cells. A higher luminosity gives a worse results and the shade of all the cells is the same just the deepness of the colour is modified.

1
votes

Copy conditionally formatted cells into Word (using CTRL+C, CTRL+V). Copy them back into Excel, keeping the source formatting. Now the conditional formatting is lost but you still have the colors and can check the RGB choosing Home > Fill color (or Font color) > More colors.

0
votes

Light red fill with dark red text.

{'bg_color':   '#FFC7CE', 'font_color': '#9C0006'})

Light yellow fill with dark yellow text.

{'bg_color':   '#FFEB9C', 'font_color': '#9C6500'})

Green fill with dark green text.

{'bg_color':   '#C6EFCE', 'font_color': '#006100'})