View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier Jon Peltier is offline
external usenet poster
 
Posts: 6,582
Default Fill color based on RGB

What version of Excel are you using. Excel 2003 and earlier had access to a
palette of only 56 colors. You could select any RGB for these 56, but you
got no more colors than these. (You can use more colors to format shapes in
the worksheet, so if you just want to display different colors, you could
use rectangles or other shapes as the tiles in your display, rather than
cells.)

Excel 2007 allows all 256^3 colors, but in itself that's not enough
justification to upgrade.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"ADK" wrote in message
...
What I would like to do is take the colors from AutoCAD (ACI) and create a
layer color table with a color sample in a cell. There are 256 colors in
autocad so to answer your question, 256. I am working on converting
AutoCAD Color Index (ACI) into RGB numbers.


"Peter T" <peter_t@discussions wrote in message
...
ADK, how many unique colours do you envisage (envision) you will need in
total in the workbook.

Mike, the approach you suggested applies the 'nearest' RGB that already
exists in the palette. IOW one of the existing palette colours will be
applied, of which there are 46 in a default palette.

Regards,
Peter T

"ADK" wrote in message
...
A beginner at this vba stuff. Looking to color a cell based on RGB
values

Column A has the R numbers
Column B has the G numbers
Column C has the B numbers
Column D will be the where the cells fill color is based on the values
entered in columns A thru C. I'll have 256 rows ...each row will end up
having a different fill color based on the values

Example

A1=255
B1=255
C1=0
D1={cell fill color would be yellow}

A2=255
B2=191
C2=0
D2={cell fill color would be orange}

Thanks in advance for your help!

ADK