View Single Post
  #1   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

Hi,

I have a sheet with maybe 870 rows, of which some rows have red text.

I want to run a program which counts how many rows are red.

I have made the following program, and it is giving me a count of 10, when
it should be around 60.

What am I doing wrong ??

I appreciate your help.

Sub Macro2()

Let b = 0

For a = 4 To 870
If Cells(a, 11).Font.Color = -16776961 Then Let b = b + 1
Next a

Cells(873, 10) = b

End Sub