Try the following code :
Code:
Function CountColor(Color As Range, Range As Range) As Long
Dim C As Range
For Each C In Range
If C.Interior.ColorIndex = Color.Interior.ColorIndex Then
CountColor = CountColor + 1
End If
Next
End Function
I do not knwo how much you know about VBA so here goes. I am assumign that you want to use this function on multiple workbooks and not just the one right now. You will need to save this function to your personel macro work book. To do this you need to go to tools, Macro, record new macro, choose personel macro workbook, Hit the little stop button or go to tools macro stop. Go to Window, Unhide, personel macro workbook. As it is unhid click Alt+F11. This will open the VBA window. Insert Module. Highlight the function from this posting and copy into your module. To use the formula type =COUNTCOLOR( Then click on cell color that you want to know the count of, Click the range that you want to count.
Bookmarks