Hey all i have a range of data i wish to count by cell color and if it contains a certain value (the month of April this year). This is my current Formula
=CountCcolorIF('2019-2020'!I3:AT3,'2019-2020'!I1,"15/04/2020")
currently only testing it with a single date rather than an entire month
And here is my VBA code
Function CountCcolorIF(range_data As Range, criteria As Range,
cellvalue As Range) As Long
Dim datax As Range
Dim xcolor As Long
xcolor = criteria.Interior.ColorIndex
Application.Volatile
For Each datax In range_data
If datax.Interior.ColorIndex = xcolor And datax.Value =
cellvalue.Value Then
CountCcolorIF = CountCcolorIF + 1
End If
Next datax
End Function
As far as i can tell everything should be functioning how i intend it too but it’s not. Could anyone offer some insight as to why?