User Defined Function - Title

F

filky

I did consider this but I e-mail the spreadsheet around to differen
people and wanted the module in the workbook I issue.

I have managed to shorten it somewhat now to;

=CountByColor.CountByColor(B$17:B$31,CellColorIndex.CellColorIndex($A3))

But I still can't find a way of referring to the function by a simpl
name. I tried the Macro-Options-Description facility but I still ge
the original full path description in the UDF menu which truncates th
end so they all look the same.

Any other thoughts? Thanks for looking by the way
 
S

Squid

How about this:

Function ColorCount(MyRange As Range, MyColorIndex As
Integer) As Double
Dim c As Range
On Error Resume Next
For Each c In MyRange.Cells
If c.Interior.ColorIndex = MyColorIndex Then _
ColorCount = ColorCount + 1
Next
End Function
 
Top