Francisco,
I once found this in the NG, I believe.
Jack Sons
The Netherlands
Sub SumColorCountYellow()
Dim Yellow6 As Integer
Dim Cell As Range
For Each Cell In Range("DataY")
If Cell.Interior.ColorIndex = 6 Then
Yellow6 = Yellow6 + Cell.Value
End If
Next
originalF = Range("F1").Value
Range("F1").Value = "Yellow = " & Yellow6
MsgBox " Yellow adds to " & Yellow6, _
vbOKOnly, "CountColor"
Range("F1").Value = originalF '""
End Sub
"Francisco" schreef in bericht
...
I have a list of data in column, they have conditioanal format to different
colors, e.g. blue, red, brown. I want to count the total number of blue.
How to do it ? The "CountIf" function does seem to help. Any suggestions
?
Thanks.
|