View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
RichardSchollar RichardSchollar is offline
external usenet poster
 
Posts: 196
Default custom cell color

John - thanks for your help (took a while replying cos the forum I
usually access this board from seems to have disappeared).

Tom - thanks for the explain too. Thanks to both of you I now know an
awful lot more about colour manipulation in Excel spreadsheets (and the
inherent limitations).

I take it that the 56 colour limit may not apply if you imbed say a
JPEG in the sheet? It doesn't seem to, but that could possibly be down
to my tired old eyes...

Best regards

Richard



Tom Ogilvy wrote:
There would be no advantage to restricting the cell to 56 colors if Excel
retained the RGB colors. It only stores the colorindex - which it must do
for every cell it maintains information about.

So you would need to change the palette first.

--
Regards,
Tom Ogilvy


"John Coleman" wrote:

Richard,

You need to explicitly change the palette in order to display a color
not on the palette (although I don't know if it strictly *has* to be
before you execute something like Range("A1").Interior.Color =
RGB(12,13,14) if the RHS is not on the palette, though I suspect it
does. I can't imagine why Excel would store more color information for
a cell than it can currently display). It doesn't seem to be
well-documented. I only discovered the limitation when I wanted an
effect that required the shading of cells to range smoothly from black
to white.

-John

RichardSchollar wrote:
John

I think I get it - so what you're saying is that you need to update the
palette *before* applying it to a sheet? Otherwise, the applied color
will default to, I presume, the closest match from the existing
palette? Am I understanding your point correctly?

Thanks & kind regards

Richard


--
RichardSchollar
------------------------------------------------------------------------
RichardSchollar's Profile: http://www.officehelp.in/member.php?userid=5248
View this thread: http://www.officehelp.in/showthread.php?t=1275010

Posted from - http://www.officehelp.in