Count by Colour in Excel
Function CountByColor(rng As Range, clrCell As Range) As Long
Dim c As Range
Dim count As Long
count = 0
For Each c In rng
If c.Interior.Color = clrCell.Interior.Color Then
count = count + 1
End If
Next c
CountByColor = count
End Function
0 Comments