I have a spreadsheet with a VBA add on for the formula =CountCcolor. It works perfectly, except that it doesn't count the cell if you fill it from the 'font' menu in the toolbar. To count a color, you need to either copy+paste, or select Format Painter.
This is the VBA.
Function CountCcolor(range_data As range, criteria As range) As Long
Dim datax As range
Dim xcolor As Long
xcolor = criteria.Interior.ColorIndex
For Each datax In range_data
If datax.Interior.ColorIndex = xcolor Then
CountCcolor = CountCcolor + 1
End If
Next datax
End Function
Bookmarks