When using VBA to code the Colorindex (or background color) of a cell it is useful to know what integer will equal what color. Below is a reference picture which shows the color and lists it’s respective Colorindex. aka VBA Color Palette

Here’s the code to make one for yourself, or just bookmark the permalink:
Sub ColorRef() Dim x As Integer For x = 1 To 56 If x < 29 Then Cells(x, 1).Interior.ColorIndex = x Cells(x, 2) = x Else Cells(x - 28, 3).Interior.ColorIndex = x Cells(x - 28, 4) = x End If Next x End Sub
July 31st, 2008 at 5:03 pm
Thanks, works great.
However, Why does excel give 56 numbers to 35 colors?
Thanks again.
October 24th, 2008 at 5:45 pm
[...] an easy way to determine what number equals what color? Check out Color Reference For Colorindex. Posted in Cells, Columns & Rows [...]