rgb colors for charts

  • Thread starter Thread starter cindy
  • Start date Start date
C

cindy

Can anyone tell me if there is a way to set rgb colors in excel charts?

thanks so much for your help....
thanks - Cindy
 
Hi,

If you are using xl2003 or older the colours are related to the 56 Colours
available via Tools > Options > Color.
Using a specific RGB value will just have it mapped to the nearest color
from the palette.
So in order to get a specific colour you will need to change the palette
color for a give color index. Note that this will effect all cells, shapes
and chart items using that color index.

Cheers
Andy
 
To add to Andy's comments, I have written a simple macro to change the
RGB values of the XL palette and arranged it by the correct colorindex
and show it in the order of the Tools Options Colors dialog since they
are not in order.

The code I wrote create 55 variations of black and to point out that
XL will find the closest color which is wrong, of course, I make one
value completely different, say all blue. And then if you try and
format something with a red, you won't even be close to a red.

Just change the RGB values in the code and run the macro. Then you can
just copy the palette from that workbook to others.

It's posted on the PPTFAQ.com page at
http://pptfaq.com/FAQ00249.htm

Brian Reilly, MVP
 
cindy;2509442 said:
Can anyone tell me if there is a way to set rgb colors in excel charts?

Cindy,
This Macro will set the default colors in a chart, (so all charts look
the same)

Code:
--------------------
Sub ChgColor()
ActiveWorkbook.Colors(7) = RGB(255, 153, 255)
ActiveWorkbook.Colors(9) = RGB(255, 124, 128)
ActiveWorkbook.Colors(10) = RGB(51, 204, 51)
ActiveWorkbook.Colors(12) = RGB(128, 128, 0)
ActiveWorkbook.Colors(13) = RGB(228, 0, 228)
ActiveWorkbook.Colors(15) = RGB(234, 234, 234)
ActiveWorkbook.Colors(38) = RGB(255, 204, 255)
ActiveWorkbook.Colors(39) = RGB(225, 195, 255)
ActiveWorkbook.Colors(40) = RGB(255, 228, 201)
ActiveWorkbook.Colors(41) = RGB(117, 150, 255)
ActiveWorkbook.Colors(44) = RGB(255, 214, 133)
ActiveWorkbook.Colors(48) = RGB(192, 192, 192)
ActiveWorkbook.Colors(50) = RGB(0, 255, 153)
ActiveWorkbook.Colors(51) = RGB(0, 128, 0)
ActiveWorkbook.Colors(52) = RGB(153, 102, 51)
ActiveWorkbook.Colors(54) = RGB(215, 135, 175)
End Sub
 
This macro changes some of the palette colors, but none of the default chart
colors, which range from colorindex 17 to 32.

- Jon
 
Back
Top