Color List?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a list that can tell me which code brings up which colors? The only
ones I know for sure (based upon other code that I've seen are the following):

3 'red
6 'yellow
5 'blue
10 'green
 
Try this,

Sub ColorList()
'Modified by Tom Ogilvy
Dim colsht As Worksheet
Dim xlcol As Integer
On Error Resume Next
Application.DisplayAlerts = False
Worksheets("Col Index List").Delete
Application.DisplayAlerts = True
On Error GoTo 0
Set colsht = Worksheets.Add
Set rng = colsht.Range("A1:G8")
With colsht
On Error Resume Next
.Name = "Col Index List"
For xlcol = 1 To 56
With rng(xlcol)
.Interior.ColorIndex = xlcol
.Value = xlcol
Select Case xlcol
Case 2, 6, 8, 19, 20, 28, 34, 35, 36, 40
.Font.ColorIndex = 1
Case Else
.Font.ColorIndex = 2
End Select
End With
Next
End With
End Sub



Regards,
Shailesh Shah
http://in.geocities.com/shahshaileshs/
(Free addins Office Menu-2003 for Office-2007)
 
one way

Sub Colors()
Dim ctr As Long

For ctr = 1 To 56
Cells(ctr, 1).Interior.ColorIndex = ctr
Cells(ctr, 2).Value = "'" & Right("000000" & _
Hex(ThisWorkbook.Colors(ctr)), 6)
Cells(ctr, 3).Value = ctr
Cells(ctr, 4).Value = Cells(ctr, 1).Interior.Color
Cells(ctr, 2).Font.Name = "Arial"
Cells(ctr, 2).HorizontalAlignment = xlRight
Cells(ctr, 3).HorizontalAlignment = xlCenter
Cells(ctr, 4).HorizontalAlignment = xlLeft
Next ctr

End Sub
 
That is really nice! Thank you to Tom for writing it and to you
for posting it.

=dman=

======================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top