Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Show +/- totals in formulas in green vs. red colors Daveman Excel Worksheet Functions 2 October 14th 06 06:05 PM
Can I sort columns by colors, example - red, green, yellow Beth Excel Discussion (Misc queries) 3 May 19th 06 05:34 AM
I want the bar chart with customer selected colors, green color f. junminliu Charts and Charting in Excel 2 March 20th 05 03:12 PM
Add fill colors: green & red & yellow on toolbar, instead clickin. moekan Excel Worksheet Functions 1 March 18th 05 04:57 PM
WHere can I find a list of ColorIndex colors? Christiane[_12_] Excel Programming 3 April 28th 04 04:12 PM


All times are GMT +1. The time now is 05:07 PM.

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"