ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Color List (https://www.excelbanter.com/excel-programming/416635-color-list.html)

JAD

Color List
 
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

Gary Keramidas

Color List
 
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

--


Gary


"JAD" wrote in message
...
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





All times are GMT +1. The time now is 07:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com