View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Programatically dim (lighten the color) of a cell.

Jeremy,

"Is there a way to do this programmatically?"
I think you are looking for...
ActiveWorkbook.Colors(47) = RGB(102, 125, 153)

Regards,
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Jeremy Gollehon"
wrote in message
...
Hi Tom,
Thanks for the reply.
Let me reword this a little (It should really have a different title).

Lets say I want to change the color of [Color 47] (RGB 102,102,153) in the
color pallete.
Currently I can go to Tools Options Color Modify Custom, and slide
the slider up a little to get a lighter color.

Is there a way to do this programatically?
The real problem is that depending on where you start in the color range,
the percentage change in Red, Green, or Blue is different as you move the
slider. I was hoping someone out there might have tackled something like
this before.
Thanks again,
Jeremy


Tom Ogilvy wrote:
Excel only displays 56 colors at a time. The color value is RGB, but
it won't be the RGB value you set unless are just lucky. It sets the
value to the closest color to the RGB value.

If you go into Tools=Options=Color Tab, you will see there are very
few colors I would call dimmer shades of other colors in the palette.
You can create your own custom palette of course.

See David McRitchie's page on this:
http://www.mvps.org/dmcritchie/excel/colors.htm


"Jeremy Gollehon" wrote in message
...
I know I can read the RGB value of a color in VBA.

Is there a consistent way to do a calculation on those values to
visually return the same color but lighter (dimmer)?

Thanks,
Jeremy