Function CountColors(Target As Range, CellColor As String)
Select Case CellColor
Case "Yellow"
SearchColor = 6
Case "Red"
SearchColor = 3
Case "Orange"
SearchColor = 9
End Select
CountColors = 0
For Each cell In Target
If Range("A1").Interior.ColorIndex = SearchColor Then
CountColors = CountColors + 1
End If
End If
End Function
Function CountColors(Target As Range, CellColor As String)
Select Case CellColor
Case "Yellow"
SearchColor = 6
Case "Red"
SearchColor = 3
Case "Orange"
SearchColor = 9
End Select
CountColors = 0
For Each cell In Target
If Range("A1").Interior.ColorIndex = SearchColor Then
CountColors = CountColors + 1
End If
Next cell
End Function
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.