Hello,
I have modified a module in order to average only cells written in black fonts how ever , it dosnt work... could anyone please tell me why ?
Function AvgColors(rng As Range)
Dim ce As Range, SumColors As Double, CountColors As Long
For Each ce In rng
If Cells(ce.Row, ce.Column).Font.ColorIndex = 1 Then
SumColors = SumColors + ce.Value
CountColors = CountColors + 1
End If
Next ce
If CountColors = 0 Then
AvgColors = 0
Else
AvgColors = SumColors / CountColors
End If
End Function
Thanks!!
Bookmarks