Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, this was what I needed :)
-- Melwin "Melanie Breden" wrote: Hi Melwin, "Melwin" schrieb: The question now is how to make a function with an unlimited amount of ranges and to be able to uses these ranges in a function. Could someone please illustrate how to do this by e.g. replicating the Sum function in excel? for one range you can use the simple Application.Sum method like this: Public Function MySum2(rng As Range) As Double MySum2 = Application.Sum(rng) End Function For unlimited ranges declare the argument as ParamArray: Public Function MySum3(ParamArray varRanges()) As Double Dim varArea As Variant For Each varArea In varRanges MySum3 = MySum3 + Application.Sum(varArea) Next varArea End Function -- Mit freundlichen GrĂ¼ssen Melanie Breden |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Undefined function | Excel Programming | |||
Make Function Public | Excel Programming | |||
# added to number in function procedure | Excel Programming | |||
Public/Procedure Variable | Excel Programming | |||
Declaring Public Procedure | Excel Programming |