I want to count the cells with text in red and black in an excel-sheet using the user defined function below:
Function FntColor(rng As Range) As String
If rng.Font.Color = RGB(0, 0, 0) Then
FntColor = "black"
ElseIf rng.Font.Color = RGB(255, 0, 0) Then
FntColor = "red"
Else: FntColor = "normal"
End If
End Function
What do I have to do to get it working in:
=COUNTIF(B5:B10,FntColor() = "black")
Function FntColor(rng As Range) As String
If rng.Font.Color = RGB(0, 0, 0) Then
FntColor = "black"
ElseIf rng.Font.Color = RGB(255, 0, 0) Then
FntColor = "red"
Else: FntColor = "normal"
End If
End Function
What do I have to do to get it working in:
=COUNTIF(B5:B10,FntColor() = "black")