View Single Post
  #5   Report Post  
bala_vb bala_vb is offline
Senior Member
 
Location: Hyderabad
Posts: 237
Thumbs up

Quote:
Originally Posted by Ms-Exl-Learner View Post
You can use the same formula which is used in Conditional Formatting for
highlighting the cells. If you might have used the [Cell value] is in
Conditional formatting other than [Formula is] then explain about the
conditions.

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"tom" wrote:

Hello All,
In Excel 2003, I am looking for a way to count colored (conditional formated
cells) in a column.

Desired outcome....
Counted cells #'s in (A1) where the colored cells are between A:2 and A:4000

TFTH
try this code, if your worksheet name is sheet1, otherwise replace your sheet name instead of sheet1

Private Sub Workbook_Open()
Dim i, j As Integer
j = 0
ActiveWorkbook.Sheets("sheet1").Select
For i = 2 To 4000
If Worksheets("sheet1").Range("A" & i).FormatConditions.Count < 0 Then
j = j + 1

End If
Next i

Worksheets("sheet1").Range("A" & 1) = j
End Sub

all the best
__________________
Thanks
Bala