Counting Cells

  • Thread starter Thread starter Pal
  • Start date Start date
P

Pal

Does anyone out there know what function I can use to
count cells which have the same font colour applied?
 
Does anyone out there know what function I can use to
count cells which have the same font colour applied?

There's no built-in function for this. How about a macro? ; such as

Sub CountFontColour()
y = ActiveCell.Font.ColorIndex
x = 0
For Each cell In Selection
If cell.Font.ColorIndex = y Then
x = x + 1
End If
Next cell
Range("B1").Value = x
MsgBox "Count = " & x & "."
End Sub

, which requires the "test cell" to be the active cell.

For proper macros dealing with colours 'n' stuff, see

http://www.cpearson.com/excel/colors.htm

HTH,
Andy
 
Back
Top