Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pass a Variable List Of Values To Subroutine or Function
Hello All,
What I want to do is create a function (maybe subroutine) that will be passed a variable number of values and perform some processing. I am not sure this is possible because the functions I have created in the past has a finite number of parameters. Has anyone done this? Thanks in advance. Dean. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pass a Variable List Of Values To Subroutine or Function
I do this frequently. Look at "Understanding Parameter Arrays" in VBA
Help In article , "Dean Hinson" wrote: What I want to do is create a function (maybe subroutine) that will be passed a variable number of values and perform some processing. I am not sure this is possible because the functions I have created in the past has a finite number of parameters. Has anyone done this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Pass a Variable List Of Values To Subroutine or Function
Take a look at ParamArray in VBA help, just what you need. Here is a simple
example Public Function weightedstdev(ParamArray rng()) Dim rngCount rngCount = UBound(rng, 1) For i = 0 To rngCount ' your code Next End Function -- HTH RP (remove nothere from the email address if mailing direct) "Dean Hinson" wrote in message ... Hello All, What I want to do is create a function (maybe subroutine) that will be passed a variable number of values and perform some processing. I am not sure this is possible because the functions I have created in the past has a finite number of parameters. Has anyone done this? Thanks in advance. Dean. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Call a subroutine using variable subroutine name | Excel Discussion (Misc queries) | |||
pass variable from one workbook to another | Excel Discussion (Misc queries) | |||
Pass variable to NORMINSV function to get only mean value | Excel Worksheet Functions | |||
How to pass a workshhet name as a parameter into a subroutine ? | Excel Discussion (Misc queries) | |||
system variable representing subroutine name? | Excel Programming |