View Single Post
  #1   Report Post  
SNC-DW SNC-DW is offline
Junior Member
 
Posts: 4
Default Counting coloured cells

Hi

I've used the following code to count the number of cells in a range that are filled yellow, using the basic funtion '=CountYellow(A1:A99)'

Function CountYellow(MyRange As Range)
Dim iCount As Integer
Application.Volatile
iCount = 0
For Each cell In MyRange
If cell.Interior.ColorIndex = 6 Then
iCount = iCount + 1
End If
Next cell
CountYellow = iCount
End Function

However I now need to count the same range of cell that are coloured but contain only zeros, any ideas?

Thanks