View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default how to get lighter shade of gray for interior color of a cell?

PS, forgot I posted a macro to display the 216 "web-safe" colours in a
worksheet here

http://tinyurl.com/fay37

Other colours in the old 256 palette are greys and system colours.

Regards,
Peter T


"Peter T" <peter_t@discussions wrote in message
...
If you want a grey just make all the RGB colours the same.

FYI, the lightest gray in a default palette is applied to colorindex 15 as
RGB(192,192,192)

You might try, say

Activeworkbook.colors(54) = rgb(204,204,204)
Activeworkbook.colors(39) = rgb(229,229,229)

Each RGB attribute should be in the range 0-255

As there are 256 x 256 x 256 = 16 million permutations, no web site will
show you all possible RGB colours. Though plenty of sites display the so
called "web safe" colours that exist in the old 256 colour palette.

Regards,
Peter T

"Rich" wrote in message
...
Thank you very much for your reply. One more question if I may - is

there
a
way to determine what color you get with RGB ? like what numbers to

select?
I have always had a problem with that using RGB. Is there maybe website

that
lists that various color you can get with RBG?

Also, I did notice that the lightest color of gray that I was able to

get
using RGB (but not adding to the palette yet) was the same shade that is
currently in the palette. So if I find an RGB number that is lighter,

and
I
add that to the palette in my respective workbook, then I can use that

color?

Thanks again.

"Jim Thomlinson" wrote:

Additionally here is a recent post from Chip...

Note that Excel supports only 56 colors, although you can specify
which 56 colors are used. If you attempt to use a color that is
not in Excel's palette of colors, Excel will use the closest
match. To use a specific color with RGB, you should set one of
the colors in the palette to that color, then use ColorIndex to
get the color to the cell. E.g,

ThisWorkbook.Colors(56) = RGB(r,g,b)
ActiveCell.Interior.ColorIndex = 56

See www.cpearson.com/excel/colors.htm for more info about working
with colors.


--
HTH...

Jim Thomlinson


"Rich" wrote:

Hello,

I recorded a macro for setting the interior color of a cell to the

lightest
gray in the color palet on the toolbar. But I need a lighter shade

of
gray.
I experimented with various color indexes, but these indexes seem to

only use
the colors from the color palet on the toolbar. Is there a way to

use
the
RGB color function maybe, to color the interior of a cell to a shade

that is
not on the color palet on the toolbar? How is this done?

Thanks,
Rich