Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |