Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Coloring | Excel Worksheet Functions | |||
calculating and coloring | Excel Worksheet Functions | |||
tab coloring | Excel Worksheet Functions | |||
CF List Coloring | Excel Discussion (Misc queries) | |||
Coloring Cells | Excel Worksheet Functions |