View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default IF Statement and Font Color

in xl2003 and earlier, the interior color of a cell can be one of 56 values
or xlnone.

if activecell.Interior.ColorIndex = 3 then
' the cells interior is red

to see the Colors associated with the colorindex

Sub ShowColors()
for i = 1 to 56
cells(i,1).Interior.ColorIndex = i
cells(i,2).Value = i
Next
End Sub

Note that the user can create a custom palatte in a workbook and map
different colors to the 56 available colorindexes.

A good discussion of Excel and colors is at
http://www.mvps.org/dmcritchie/excel/colors.htm

--
Regards,
Tom Ogilvy


" wrote:

Is there a way to have an IF statement check a cell and do something
according to the color of the font?