Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default coloring limits

Can we color the Excel sheet cells with any desired color through VBA (using
RGB function for example) or we are restricted with the color set that we
can use from the worksheet?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default coloring limits

Marwan,

Excel has a color pallet of 56 colors -- everything in Excel
(Fonts, Backgrounds, Charts, etc) must be one of those 56 colors.
However, you can put any of the 16 million RGB colors in to the
pallet. You can define your own color pallet using code like

ThisWorkbook.Colors(56) = RGB(123, 45, 67)

This defines color 56 to be the color value produced by RGB(123,
45, 67). You can assign any or all of the 1 to 56 Color array
elements to whatever colors you desire. When you change a color
value in the Colors array, all elements (text, backgrounds, etc)
that use that ColorIndex will use the new color value. For
example, if you use code like

Range("A1").Interior.ColorIndex = 42

you are using Colors(42). If you then change Colors(42) to
another color with code like

ThisWorkbook.Colors(56) = RGB(123, 45, 67)

then A1 will have the new color.

So in summary, yes, you are limited to 56 colors, but each of
those colors can be any of 16 million available colors.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"marwan hefnawy" wrote in message
...
Can we color the Excel sheet cells with any desired color

through VBA (using
RGB function for example) or we are restricted with the color

set that we
can use from the worksheet?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Coloring Elton Law[_2_] Excel Worksheet Functions 2 April 5th 10 03:22 PM
calculating and coloring [email protected] Excel Worksheet Functions 1 January 9th 08 03:11 PM
tab coloring rmstafford Excel Worksheet Functions 2 April 24th 07 01:08 AM
CF List Coloring Sean Excel Discussion (Misc queries) 1 March 22nd 07 06:56 PM
Coloring Cells Gabbi Excel Worksheet Functions 2 July 27th 05 09:54 PM


All times are GMT +1. The time now is 07:39 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"