Hi,
I use 2003 and use this function quite frequently.
The UDF I use is:
Function countfontcolour(Colour_Sample As Range, Cell_Range As Range)
Dim rCell As Range
Dim lCol As Long
Dim lResult As Long
Application.Volatile
lCol = Colour_Sample.Font.ColorIndex
For Each rCell In Cell_Range
If rCell.Font.ColorIndex = lCol Then
lResult = 1 + lResult
End If
Next rCell
countfontcolour = lResult
End Function
To use it enter:
=countfontcolour(Colour_Sample,Cell_Range)
so if A1 contains the colour you want to count (eg. Value with Red Font) and D1:D50 is the range you want to count those with red font then use it like so:
=countfontcolour(A1,D1:D50)
Thanks
Bookmarks