View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default User Defined Function - Using Cell Range

Function SumRange(rng As Range) As Double

SumRange = Application.WorksheetFunction.Sum(rng)

End Function


Sub test()

MsgBox SumRange(Range(Cells(1), Cells(3, 2)))

End Sub


RBS

"I need help please" wrote in
message ...
Hello,
I have a question about creating a user defined function...

I want it to make some calculations based off of static cell ranges. I
was
hoping I could use either a named range, or just type in a static range in
the function.

Like, how would I do WorksheetFunction.SUM(RANGE) in a UDF?