Thread: [Solved] If color is red then active
View Single Post
 
Old 01-09-2012, 01:41 AM
Catalin.B Catalin.B is offline Windows Vista Office 2010 32bit
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

You can use the UDF below:
Code:
Function CellColorIndex(InRange As Range, Optional _
    OfText As Boolean = False) As Integer

Application.Volatile True
If OfText = True Then
    CellColorIndex = InRange(1, 1).Font.ColorIndex
Else
    CellColorIndex = InRange(1, 1).Interior.ColorIndex
End If

End Function
Then in the cell: =If(cellcolorindex(A4)=3;"Expired";"")
Reply With Quote