Highlighted Cells (Colors)


Posted by Jo on January 07, 2002 3:52 PM

I asked (And got the answer) earlier about highlighting the current cell you were on. I put the code into the sheet tab. But, I have another question. Is the only color you can use blue? And, what are the codes for the other colors if you can use more?



Posted by faster on January 07, 2002 4:18 PM

You can use 56 different colors. Search for color index in help.

This is kind of cool. Run it in a blank workbook.
It will show you the color index number and color.

Sub CellColors()
Dim i
For i = 1 To 56

Range("A" & i).Interior.ColorIndex = i
Range("B" & i) = i

Next i

End Sub