ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I test a specific color in 2003? (https://www.excelbanter.com/excel-worksheet-functions/181648-how-do-i-test-specific-color-2003-a.html)

Sp3ct4tor

How do I test a specific color in 2003?
 
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.

Gary''s Student

How do I test a specific color in 2003?
 
Try this UDF:

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

--
Gary''s Student - gsnu200776


"Sp3ct4tor" wrote:

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.



All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com