Color List

J

JAD

Can anyone point me to a source that will give me all the colors available
with code that I can use for the fore and background colors in a Toggle
Button? Also, instead of entering a color in VB such as vbBlack, can you also
defined the color by entering numbers? Any help would be appreciated. Thank
You, JAD
 
G

Gary Keramidas

maybe this will help


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
 

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

Top