I want to test a particular cell or cells for font color. For example if the color is red perform some action. If the color is balck then write "PASS".
This seems simple enough but my test code below doesn't work.
1) I selected a cell
2) Printed the word "message"
3) Changed the font color to red
4) Test for black
5) If black, pront "Pass" in adjacent cell
Obvioulsly doing something wrong. I beiieve the values for the colots, 3 for red and 0 for black are correct. Any suggestions?
Sub Macro1()
Range("U48").Select
ActiveCell.FormulaR1C1 = "message"
Selection.Font.ColorIndex = 3
If ActiveCell.Font.ColorIndex = 0 Then
Range("U49").Value = "PASS"
End If
End Sub
Bookmarks