Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 157
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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/







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
Help in color index function [email protected] Excel Worksheet Functions 2 September 19th 08 03:52 AM
Color Index Code, is there any thing like that? wilchong via OfficeKB.com New Users to Excel 3 May 22nd 08 01:56 PM
Custom Color/Color Index FARAZ QURESHI Excel Discussion (Misc queries) 4 February 29th 08 05:19 PM
Chart axes color index vs font color index [email protected] Charts and Charting in Excel 4 December 7th 06 04:05 PM
How To: Get the index value of the selected color KM[_2_] Excel Programming 1 December 10th 03 04:42 PM


All times are GMT +1. The time now is 08:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"