View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
מיכאל (מיקי) אבידן מיכאל (מיקי) אבידן is offline
external usenet poster
 
Posts: 561
Default Count yellow-highlited rows

As Luke said - there are several ways.
1) UDF:
Function CountIntColor(MyColor As Range, MySumRange As Range)
Application.Volatile
IntCol = MyColor.Interior.ColorIndex
For Each CL In MySumRange
If CL.Interior.ColorIndex = IntCol Then
Counter = Counter + 1
End If
Next
CountIntColor = Counter
End Function
===========
The first argument is the range of colored cells to be counted.
The second argument will refere to a single cell colored with YELLOW.
***************************************
2) Using the CELL function. Look it up in Excels Help
3) In Excel "2007"/"2010" - you can filter by Cell Interior color and count
the visible cells with SUBTOTAL function.
Micky


"Vic" wrote:

What is the formula to count how many lines are highlited in yellow?
Thank you.