View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
William[_2_] William[_2_] is offline
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
|
|
|
|
|