How do I test a specific color in 2003?

S

Sp3ct4tor

I need to include a color test into If function.
Example:
If font text in cell A1 is green, then write "400"
(I have more colors to test than 2 so I can't use the CELL function)

Thanks in advance.
 
G

Gary''s Student

Try this UDF:

Function fontcolor(r As Range) As Integer
Application.Volatile
fontcolor = r.Font.ColorIndex
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top