View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Need to count formated Cells in Excel Macro

See http://www.xldynamic.com/source/xld.ColourCounter.html for a working
solution

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

wrote in message
oups.com...
I used a Macro to format cells based on given criteria. But now I need
a Macro to count those formatted cells and print them in a seperate
cell. I want to to use the count feature but I can't figure out how to
just count the formatted cells. This is the Macro I used to format the
cells based on the criteria:

Sub P2()


Dim LastRow As Long
Dim iRow As Long


With ActiveSheet
LastRow = .Cells(.Rows.Count, "C").End(xlUp).Row


For iRow = 3 To LastRow
If .Range("C" & iRow).Value < .Range("H" & iRow).Value Then
.Range("H" & iRow).Interior.Color = RGB(200, 160, 35)
End If
Next iRow
End With
End Sub



Anybody got any ideas????????????