Thanks for your help
On the site I found the following code which look like it will work but I am
new to excel and unsure how to insert the code.
Any chance that someone could insert it into an excel chart for me to show
me how to do it.
I am a teacher and would appreciate any help.
Thanks in advance
Babs
Counting Cells With A Specific Color
The following function will return the number of cells in a range that have
either an Interior (background) or Font of a specified color. InRange is
the range of cells to examine, WhatColorIndex is the ColorIndex value to
count, and OfText indicates whether to return the ColorIndex of the Font
(if OfText is True) or the Interior (if OfText is False or omitted).
Function CountByColor(InRange As Range, _
WhatColorIndex As Integer, _
Optional OfText As Boolean = False) As Long
'
' This function return the number of cells in InRange with
' a background color, or if OfText is True a font color,
' equal to WhatColorIndex.
'
Dim Rng As Range
Application.Volatile True
For Each Rng In InRange.Cells
If OfText = True Then
CountByColor = CountByColor - _
(Rng.Font.ColorIndex = WhatColorIndex)
Else
CountByColor = CountByColor - _
(Rng.Interior.ColorIndex = WhatColorIndex)
End If
Next Rng
End Function
Chip Pearson has some notes on counting by colour here:
http://www.cpearson.com/excel/colors.htm
Perhaps you can make use of some of his routines.
Hope this helps.
Pete