Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Hi,
In VB I want to use the fill color option based on certain conditions. I know that yellow has a color index value 6. I want to know where I can find a glossary for all the color index values. Please tell me the source for the same. I searched in MS VB help but couldnt find the same. Regards, Hari India |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Hari
Run this code on an empty worksheet. Sub CheckColorIndex() 'by Wilson -- creates colour chart on worksheet Dim CurrVal As Integer Dim ColorChart As Range Dim cell As Range Set ColorChart = Range("A1:G8") CurrVal = 1 For Each cell In ColorChart With cell ..Value = CurrVal ..Font.Size = 14 ..Font.Bold = True ..Font.ColorIndex = 2 ..Interior.ColorIndex = cell.Value ..Interior.Pattern = xlSolid CurrVal = CurrVal + 1 End With Next cell End Sub -- XL2002 Regards William "Hari" wrote in message ... | Hi, | | In VB I want to use the fill color option based on certain conditions. | | I know that yellow has a color index value 6. | | I want to know where I can find a glossary for all the color index values. | | Please tell me the source for the same. I searched in MS VB help but couldnt | find the same. | | Regards, | Hari | India | | | | | |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Hi Hari
See if David McRitchie's http://www.mvps.org/dmcritchie/excel/colors.htm is of help. And this little macro: Sub Colors() Dim L As Long For L = 1 To 56 Cells(L, 1).Interior.ColorIndex = L Cells(L, 2).Font.ColorIndex = L Cells(L, 2).Value = "Colorindex " & L Cells(L, 3).Value = "Colorindex " & L Next End Sub HTH. Best wishes Harald "Hari" skrev i melding ... Hi, In VB I want to use the fill color option based on certain conditions. I know that yellow has a color index value 6. I want to know where I can find a glossary for all the color index values. Please tell me the source for the same. I searched in MS VB help but couldnt find the same. Regards, Hari India |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Lockup ColorIndex property in VBA Help.
-- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Hari" wrote in message ... Hi, In VB I want to use the fill color option based on certain conditions. I know that yellow has a color index value 6. I want to know where I can find a glossary for all the color index values. Please tell me the source for the same. I searched in MS VB help but couldnt find the same. Regards, Hari India |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Hari,
You can run this in an empty worksheet: Sub test() Dim i As Double i = 0 On Error Resume Next ActiveSheet.Cells.Clear While Err = 0 i = i + 1 ActiveSheet.Cells(i, 1) = i ActiveSheet.Cells(i, 2).Interior.ColorIndex = i Wend ActiveSheet.Cells(i, 1).Clear End Sub hth, Doug Glancy "Hari" wrote in message ... Hi, In VB I want to use the fill color option based on certain conditions. I know that yellow has a color index value 6. I want to know where I can find a glossary for all the color index values. Please tell me the source for the same. I searched in MS VB help but couldnt find the same. Regards, Hari India |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
I prefer
For x = 1 To 56 Cells(x, 1).Interior.ColorIndex = x Next x - Piku -- Message posted from http://www.ExcelForum.com |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Sure. Until I wrote it I didn't know how many colors there were. Plus, I
didn't know if there were more colors in later versions than my xl2000. Doug "pikus " wrote in message ... I prefer For x = 1 To 56 Cells(x, 1).Interior.ColorIndex = x Next x - Pikus --- Message posted from http://www.ExcelForum.com/ |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Hi Doug,
If that is a question, 56 colors in the palette in all current versions of Excel. As far as the future goes use Dimension as long instead of integer, then if Excel is changed you'll be in better shape. 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 "Doug Glancy" wrote ... Sure. Until I wrote it I didn't know how many colors there were. Plus, I didn't know if there were more colors in later versions than my xl2000. Doug "pikus " wrote in message ... I prefer For x = 1 To 56 Cells(x, 1).Interior.ColorIndex = x Next x - Pikus --- Message posted from http://www.ExcelForum.com/ |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Could you expand on the Dimension comment? I actually Dimensioned as a
Double, not Integer, although normally I would have done a Long, but I thought I read a post somewhere that Double was more efficient since it was native. As Pikus said earlier today "learn the basics and then you won't be confused." ! Doug "David McRitchie" wrote in message ... Hi Doug, If that is a question, 56 colors in the palette in all current versions of Excel. As far as the future goes use Dimension as long instead of integer, then if Excel is changed you'll be in better shape. 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 "Doug Glancy" wrote ... Sure. Until I wrote it I didn't know how many colors there were. Plus, I didn't know if there were more colors in later versions than my xl2000. Doug "pikus " wrote in message ... I prefer For x = 1 To 56 Cells(x, 1).Interior.ColorIndex = x Next x - Pikus --- Message posted from http://www.ExcelForum.com/ |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Hi Doug,
This should look familiar: It would be looking for a whole number not something with a decimal fraction. And long works faster than 2 byte integer anyway -- at least that's what I think I've read in the newsgroups. Long Data Type Long (long integer) variables are stored as signed 32-bit (4-byte) numbers ranging in value from -2,147,483,648 to 2,147,483,647. The type-declaration character for Long is the ampersand (&). Double Data Type Double (double-precision floating-point) variables are stored as IEEE 64-bit (8-byte) floating-point numbers ranging in value from -1.79769313486231E308 to -4.94065645841247E-324 for negative values and from 4.94065645841247E-324 to 1.79769313486232E308 for positive values. The type-declaration character for Double is the number sign (#). --- 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 "Doug Glancy" wrote in message ... Could you expand on the Dimension comment? I actually Dimensioned as a Double, not Integer, although normally I would have done a Long, but I thought I read a post somewhere that Double was more efficient since it was native. As Pikus said earlier today "learn the basics and then you won't be confused." ! Doug "David McRitchie" wrote in message ... Hi Doug, If that is a question, 56 colors in the palette in all current versions of Excel. As far as the future goes use Dimension as long instead of integer, then if Excel is changed you'll be in better shape. 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 "Doug Glancy" wrote ... Sure. Until I wrote it I didn't know how many colors there were. Plus, I didn't know if there were more colors in later versions than my xl2000. Doug "pikus " wrote in message ... I prefer For x = 1 To 56 Cells(x, 1).Interior.ColorIndex = x Next x - Pikus --- Message posted from http://www.ExcelForum.com/ |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
David,
Thanks. I'm a little less confused now! Doug "David McRitchie" wrote in message ... Hi Doug, This should look familiar: It would be looking for a whole number not something with a decimal fraction. And long works faster than 2 byte integer anyway -- at least that's what I think I've read in the newsgroups. Long Data Type Long (long integer) variables are stored as signed 32-bit (4-byte) numbers ranging in value from -2,147,483,648 to 2,147,483,647. The type-declaration character for Long is the ampersand (&). Double Data Type Double (double-precision floating-point) variables are stored as IEEE 64-bit (8-byte) floating-point numbers ranging in value from -1.79769313486231E308 to -4.94065645841247E-324 for negative values and from 4.94065645841247E-324 to 1.79769313486232E308 for positive values. The type-declaration character for Double is the number sign (#). --- 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 "Doug Glancy" wrote in message ... Could you expand on the Dimension comment? I actually Dimensioned as a Double, not Integer, although normally I would have done a Long, but I thought I read a post somewhere that Double was more efficient since it was native. As Pikus said earlier today "learn the basics and then you won't be confused." ! Doug "David McRitchie" wrote in message ... Hi Doug, If that is a question, 56 colors in the palette in all current versions of Excel. As far as the future goes use Dimension as long instead of integer, then if Excel is changed you'll be in better shape. 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 "Doug Glancy" wrote ... Sure. Until I wrote it I didn't know how many colors there were. Plus, I didn't know if there were more colors in later versions than my xl2000. Doug "pikus " wrote in message ... I prefer For x = 1 To 56 Cells(x, 1).Interior.ColorIndex = x Next x - Pikus --- Message posted from http://www.ExcelForum.com/ |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
I am very impressed with all of the examples given here. I am stil
very new to the whole Macro/VBA scene. i am only used to writing code out of neccessity, but are there any more "fun" codes like these tha you can give me? I mean, codes that don't actually do anything ver important, but just are fun to watch or do? do you know what i mean -- Message posted from http://www.ExcelForum.com |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
Scott,
On Sunday, Dick Kusleika on his blog http://www.dicks-blog.com, mentioned Andy Pope's site http://www.andypope.info which has some really beautiful stuff. John Walkenbach's site has a whole section of Excel oddities at http://j-walk.com/ss/excel/odd/index.htm. hth, Doug Glancy "scottnshelly " wrote in message ... I am very impressed with all of the examples given here. I am still very new to the whole Macro/VBA scene. i am only used to writing codes out of neccessity, but are there any more "fun" codes like these that you can give me? I mean, codes that don't actually do anything very important, but just are fun to watch or do? do you know what i mean? --- Message posted from http://www.ExcelForum.com/ |
#14
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
There's also a page called "Insane Excel" by Dermot Balson with some strange
stuff in it: http://www.webace.com.au/~balson/Ins...l/Default.html HTH. Best wishes Harald "scottnshelly " skrev i melding ... I am very impressed with all of the examples given here. I am still very new to the whole Macro/VBA scene. i am only used to writing codes out of neccessity, but are there any more "fun" codes like these that you can give me? I mean, codes that don't actually do anything very important, but just are fun to watch or do? do you know what i mean? --- Message posted from http://www.ExcelForum.com/ |
#15
Posted to microsoft.public.excel.programming
|
|||
|
|||
Color index values
I wrote a cool little program that looped through all the colors an
assigned a different one to each cell's interior. I got a really coo pattern since the screen can only display so many colors at a time I was especially cool when I filled them in diagonally (A1, A2, B1, A3 B2, C1, etc...) I lost the code I used, but it was pretty easy in th first place. Like this: For r = 1 To 255 For g = 1 To 255 For b = 1 To 255 blah blah blah = (r, g, b) Next b Next g Next r - Piku -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help in color index function | Excel Worksheet Functions | |||
Color Index Code, is there any thing like that? | New Users to Excel | |||
Custom Color/Color Index | Excel Discussion (Misc queries) | |||
Chart axes color index vs font color index | Charts and Charting in Excel | |||
How To: Get the index value of the selected color | Excel Programming |