Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What are the values for ColorIndex 's 56 colors ? i.e. green=3 .
What are the values for ColorIndex 's 56 colors ? i.e. green=3 ... Or
where can a table of the values be found ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What are the values for ColorIndex 's 56 colors ? i.e. green=3 .
Option Explicit
Sub ShowColors() Dim i As Long For i = 0 To 56 Cells(i + 1, 1) = i Cells(1 + i, 3).Interior.ColorIndex = i Cells(1 + i, 2) = Cells(1 + i, 3).Interior.Color Next End Sub "RandyDtg1" wrote: What are the values for ColorIndex 's 56 colors ? i.e. green=3 ... Or where can a table of the values be found ? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What are the values for ColorIndex 's 56 colors ? i.e. green=3 .
Excel Help file, Programming Information, Microsoft Excel Visual Basic
Reference, Properties... ColorIndex Property. GIves a table showing values & corresponding colors. "RandyDtg1" wrote: What are the values for ColorIndex 's 56 colors ? i.e. green=3 ... Or where can a table of the values be found ? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
What are the values for ColorIndex 's 56 colors ? i.e. green
once you decided on your colors, use an ENU< varaible to set them. It makes
code so much easier to read example: a small sub to color thre eranges Sub tester() Range("B2:C2").Interior.Color = 255 Range("B2:C2").Interior.Color = 16711680 Range("B2:C2").Interior.Color = 65280 End Sub looks clearer this way:- Option Explicit Enum eColor Red = 255 Blue = 16711680 Green = 65280 End Enum Sub tester() Range("B2:C2").Interior.Color = eColor.Red Range("B2:C2").Interior.Color = eColor.Blue Range("B2:C2").Interior.Color = eColor.Green End Sub Patrick "Patrick Molloy" wrote: Option Explicit Sub ShowColors() Dim i As Long For i = 0 To 56 Cells(i + 1, 1) = i Cells(1 + i, 3).Interior.ColorIndex = i Cells(1 + i, 2) = Cells(1 + i, 3).Interior.Color Next End Sub "RandyDtg1" wrote: What are the values for ColorIndex 's 56 colors ? i.e. green=3 ... Or where can a table of the values be found ? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
What are the values for ColorIndex 's 56 colors ? i.e. green=3 .
Hi Randy,
Color Palette and the 56 Excel ColorIndex Colors http://www.mvps.org/dmcritchie/excel/colors.htm If you want to know where it is in your Excel Help, it isn't, it is in your VBE Help colorindex property --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "RandyDtg1" wrote .. What are the values for ColorIndex 's 56 colors ? i.e. green=3 ... Or where can a table of the values be found ? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
What are the values for ColorIndex 's 56 colors ? i.e. green=3 .
David McCritchie has a lot of code on his site. however, i find it a bit confusing to use names. to me it's simple : i KNOW the position on the ColorFill palet. so i have a little function mapping palette location to colorindex. Sub DemoUse() 'Green ActiveCell(1, 1).Interior.ColorIndex = ColorMap(4, 4) 'Orange ActiveCell(2, 1).Interior.ColorIndex = ColorMap(2, 2) End Sub Function ColorMap&(PaletteRow&, PaletteCol&) Dim PaletteIndex& Static aIdx If IsEmpty(aIdx) Then aIdx = Array(1, 53, 52, 51, 49, 11, 55, 56, 9, 46, 12, _ 10, 14, 5, 47, 16, 3, 45, 43, 50, 42, 41, 13, 48, 7, 44, _ 6, 4, 8, 33, 54, 15, 38, 40, 36, 35, 34, 37, 39, 2, 17, _ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, _ 32) If LBound(aIdx) = 0 Then ReDim Preserve aIdx(1 To UBound(aIdx) + 1) End If End If PaletteIndex = (PaletteRow - 1) * 8 + PaletteCol If PaletteIndex = 1 And PaletteIndex <= 56 Then ColorMap = aIdx(PaletteIndex) Else ColorMap = xlNone End If End Function -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam RandyDtg1 wrote : What are the values for ColorIndex 's 56 colors ? i.e. green=3 ... Or where can a table of the values be found ? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Where is ColorIndex table in Excel VBA Help
Thanks for all the help.
I can not find any ColorIndex table in Excel VBA Help, if you can tell me where, that would also be great. Thanks. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
What are the values for ColorIndex 's 56 colors ? i.e. green=3 .
Keep in mind that the user can modify the color palette; each workbook can
have its own variation. On Mon, 11 Apr 2005 05:52:01 -0700, RandyDtg1 wrote: What are the values for ColorIndex 's 56 colors ? i.e. green=3 ... Or where can a table of the values be found ? |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Where is ColorIndex table in Excel VBA Help
Randy: each workbook has its own .Colors, an array of 56 rgb values which can be modified by the user, via Tools/Options/Colors. the colorindex property found in many excel objects points to that array. if you set a .COLOR property of an object to some specified RGB value: the 'nearest' RGB value is searched in the .COLORS array and the INDEX to that value (the COLORINDEX) is then stored with the object. Note that your object will NOT be colored with that exact RGB value, but by the RGB value in the workbooks.Colors() array at position COLORINDEX. If you want to create your 'housestyle' you must change the rgb values in the workbook's colors array. Since the order of the colorindexes in the default colors array is 'somewhat' haphazard (and imo has no obvious logic to it). You'd expect that ColorIndex 5 would point to the 5th icon on the 'Palette' (the Fill Colors toolbar), but alas that is not so. So therefor I use my ColorMap function. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam RandyDtg1 wrote : Thanks for all the help. I can not find any ColorIndex table in Excel VBA Help, if you can tell me where, that would also be great. Thanks. |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Where is ColorIndex table in Excel VBA Help
I don't think it is in xl2000 and later. It is in xl97 for sure.
-- Regards, Tom Ogilvy "RandyDtg1" wrote in message ... Thanks for all the help. I can not find any ColorIndex table in Excel VBA Help, if you can tell me where, that would also be great. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Show +/- totals in formulas in green vs. red colors | Excel Worksheet Functions | |||
Can I sort columns by colors, example - red, green, yellow | Excel Discussion (Misc queries) | |||
I want the bar chart with customer selected colors, green color f. | Charts and Charting in Excel | |||
Add fill colors: green & red & yellow on toolbar, instead clickin. | Excel Worksheet Functions | |||
WHere can I find a list of ColorIndex colors? | Excel Programming |