hi
Sub countcolor()
Dim rng As Range
Dim cnt As Long
Set rng = Range("A2:I30")
cnt = 0
For Each cell In rng
If cell.Interior.ColorIndex = 40 Then
cnt = cnt + 1
End If
Next
MsgBox cnt
'or Range("K2").Value = cnt
End Sub
see this site for color indexes...
http://www.mvps.org/dmcritchie/excel/colors.htm
regards
FSt1
"David" wrote:
Is there a function to count the cells in a range, which have a given
interior color?