count conditional format colour

  • Thread starter Thread starter shital
  • Start date Start date
S

shital

i have given some conditional format to the cell. which
have red, green & black colour. Can it count the cell how
much cell in red colour & green & black.

Thanks in Advance

Shital
..
 
Use the same conditions for counting that you used to colour the cells.
For example, =COUNTIF(G2:G30,"<40")
 
This will count the red. modify to suit.

Sub countcolor()
For Each c In [a1:a10]
If c.Interior.ColorIndex = 46 Then mc = mc + 1
Next
MsgBox mc
End Sub
 
Back
Top