Thread: Custom Function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default Custom Function

Enter as :

Function zum(r As Range) As Variant
Dim rr As Range
zum = 0#
For Each rr In r
zum = zum + rr.Value
Next
End Function


use as:

=zum(B1:B6)
--
Gary''s Student


"SPeterson" wrote:

I am creating a custom function and want one of my arguments to be a range.
For example, the sum function accepts a range argument (=Sum(range)). How
does the Sum function define that range argument? Fill in the blank for me
and it should help me with my problem.

Function Sum(???)

Sum = ???

End Function