Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Arrays as Arguments in Functions
I'm having some trouble with this function. I want to
preserve the values of array between calls to a function. But I cannot figure out how to define the argument for the function and what the call function statement should look like. Has anyone done this? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Arrays as Arguments in Functions
You can either declare the arrays as static or as module level variables.
Charles ______________________ Decision Models The Excel Calculation Site. www.DecisionModels.com "Dean" wrote in message ... I'm having some trouble with this function. I want to preserve the values of array between calls to a function. But I cannot figure out how to define the argument for the function and what the call function statement should look like. Has anyone done this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Arrays as Arguments in Functions
Hi Dean,
I'm having some trouble with this function. I want to preserve the values of array between calls to a function. But I cannot figure out how to define the argument for the function and what the call function statement should look like. Has anyone done this? Something like this (untested): Sub Test() Dim asStuff(0 to 1) As String asStuff(0) = "Hello" asStuff(1) = "Goodbye" MsgBox WhatString(asStuff) End Sub Function WhatString(ByRef asArray() As String) As String WhatString = asArray(0) & ", " & asArray(1) End Function Regards Stephen Bullen Microsoft MVP - Excel www.BMSLtd.ie |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Arrays as Arguments in Functions
Thanks! I thought I had to use as Variant and it wasn't working. *** Sent via Devdex http://www.devdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Working with arrays as arguments | Excel Worksheet Functions | |||
Errors on Functions with many arguments | Excel Worksheet Functions | |||
arguments in MATCH and OFFSET functions | Excel Worksheet Functions | |||
Why do functions not allow commas to seperate arguments | Excel Worksheet Functions | |||
Need know what are valid SUMPRODUCTS arguments and functions | Excel Worksheet Functions |