sorry that i wasn't clear. here is the function
Function SumByColor(InRange As Range, WhatColorIndex As Integer, _
Optional OfText As Boolean = False) As Double
'
' This function return the SUM of the values of cells in
' InRange with a background color, or if OfText is True a
' font color, equal to WhatColorIndex.
'
Dim Rng As Range
Dim OK As Boolean
Application.Volatile True
For Each Rng In InRange.Cells
If OfText = True Then
OK = (Rng.Font.ColorIndex = WhatColorIndex)
Else
OK = (Rng.Interior.ColorIndex = WhatColorIndex)
End If
If OK And IsNumeric(Rng.Value) Then
SumByColor = SumByColor + Rng.Value
End If
Next Rng
End Function

Signature
aprilshowers
> hi
> there are 10 different function on that page not counting "other function".
[quoted text clipped - 9 lines]
> >
> > thank you
Chip Pearson - 06 Dec 2007 19:16 GMT
Make sure you put the code in a code module (Insert menu, Module), NOT the
ThisWorkbook module and not one of the Sheet modules. Also, the code must be
in the same workbook as the cell that calls it.

Signature
Cordially,
Chip Pearson
Microsoft MVP - Excel, 10 Years
Pearson Software Consulting
www.cpearson.com
(email on the web site)
> sorry that i wasn't clear. here is the function
>
[quoted text clipped - 38 lines]
>> >
>> > thank you
FSt1 - 06 Dec 2007 19:21 GMT
hi
I am guessing bob is right. i put the function in my personal.xls and try to
sum some color in a blank workbook. got the name error. but when i put the
function in the blank workbook, it worked. countbycolor too.
first time i have work with that and bob is way more experienced than me.
regards
FSt1
> sorry that i wasn't clear. here is the function
>
[quoted text clipped - 35 lines]
> > >
> > > thank you
Gord Dibben - 06 Dec 2007 19:33 GMT
FSt1
If you preface the function name with Personal.xls you will not get the error.
=Personal.xls!SumByColor(A1:A10)
Gord Dibben MS Excel MVP
>hi
>I am guessing bob is right. i put the function in my personal.xls and try to
[quoted text clipped - 43 lines]
>> > >
>> > > thank you