Here is code that will work if the cells are red by standard format method.
Sub cntclr()
Count = 0
For Each C In Worksheets(1).Range("A1:F20") 'Change range for needs.
If C.Interior.ColorIndex = 3 Then
Count = Count + 1
End If
Next
MsgBox Count
End Sub
In that case you just insert the FormatConditions property like:
Sub cntclr()
Count = 0
For Each C In Worksheets(1).Range("A1:F20") 'Change range for needs.
If C.FormatConditions.Interior.ColorIndex = 3 Then
Count = Count + 1
End If
Next
MsgBox Count
End Sub
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.