Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you Gord, this may be the handiest of all the solutions.
MT Gord Dibben wrote: Mark Couple of macros for colors listing. Sub colors56() 'David McRitchie '57 colors, 0 to 56 'needs ATP loaded Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Dim i As Long Dim str0 As String, Str As String Sheets.Add For i = 0 To 56 Cells(i + 1, 1).Interior.ColorIndex = i Cells(i + 1, 1).Value = "[Color " & i & "]" Cells(i + 1, 2).Font.ColorIndex = i Cells(i + 1, 2).Value = "[Color " & i & "]" str0 = Right("000000" & Hex(Cells(i + 1, 1).Interior.Color), 6) 'Excel shows nibbles in reverse order so make it as RGB Str = Right(str0, 2) & Mid(str0, 3, 2) & Left(str0, 2) 'generating 2 columns in the HTML table Cells(i + 1, 3) = "#" & Str & "#" & Str & "" Cells(i + 1, 4).Formula = "=Hex2dec(""" & Right(str0, 2) & """)" Cells(i + 1, 5).Formula = "=Hex2dec(""" & Mid(str0, 3, 2) & """)" Cells(i + 1, 6).Formula = "=Hex2dec(""" & Left(str0, 2) & """)" Cells(i + 1, 7) = "[Color " & i & ")" Next i done: Application.Calculation = xlCalculationAutomatic Application.ScreenUpdating = True End Sub Sub ListColorIndexes() 'John Walkenbach Dim Ndx As Long Sheets.Add For Ndx = 1 To 56 Cells(Ndx, 1).Interior.ColorIndex = Ndx Cells(Ndx, 2).Value = Hex(ThisWorkbook.Colors(Ndx)) Cells(Ndx, 3).Value = Ndx Next Ndx End Sub Gord Dibben Excel MVP On Mon, 19 Jul 2004 19:55:30 -0700, Mark Tangard wrote: Hm. Actually it still doesn't come up in my VBA Help (XL 2000).... These do work; but I was hoping to find the constants for all 40 of the colors that can be applied to a cell interior from the toolbar dropdown. Are these not all available as VBA constants? TIA |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Array Constants | Excel Worksheet Functions | |||
Constants in Excel | Excel Discussion (Misc queries) | |||
How to get a dump of Fill Color & Font VBA Constants? | Excel Discussion (Misc queries) | |||
vba constants for excel | Excel Discussion (Misc queries) | |||
constants | Excel Discussion (Misc queries) |