View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
RajenRajput1 RajenRajput1 is offline
external usenet poster
 
Posts: 40
Default How to count number of red font cells or rows

Thank you,

I tried both options, Joel and Incidental.

Joel, sorry, it didn't work.

And Incidental, it gave me a count of 867. That is the same as 870-4
(inclusive).

I have triple checked, and the font color is red and the stated font color
number (index) is correct.

I like the idea of counting the non black cells, it makes sense, but it is
saying that they all are, when they are not.

I still require a little help.

Thanks

"Incidental" wrote:

Hi

the code below is one way of doing what your after.

Option Explicit
Dim MyCell, MyRng As Range
Dim i As Integer

Sub CountReds()

Set MyRng = Range("A4:A870")

For Each MyCell In MyRng

If MyCell.Font.ColorIndex = 3 Then

i = i + 1

End If

Next MyCell

Cells(873, 10) = i

End Sub

Hope this helps

Steve