Customizing colors

P

pmguerra

Hi!

I've used the following code to change the cell color.

Sub dfghrth()

ActiveCell.Interior.Color = RGB(221, 255, 221)

End Sub



But instead of actually changing to the color I've defined, it changes
to a pallette default color...

Help anyone?
 
G

Guest

A worksheet can only display 56 predefined colors (the palette).

You will need to redefine the palette to provide the colors you need or you
will get the behavior you describe.

http://www.mvps.org/dmcritchie/excel/colors.htm

A posible workaround is to use a shape/autoshape instead of a cell as these
can display more simultaneous colors.
 
H

Harald Staff

You have to change the pallette, Excel has no more than 56 colors to work
with:

If ActiveCell.Interior.ColorIndex > 2 Then _
ActiveWorkbook.Colors(ActiveCell.Interior.ColorIndex) = _
RGB(221, 255, 221)

HTH. Best wishes Harald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top