Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
arrays
i have a function that returns an array. how do i need the Dim the variable so that vba will allow me to have Variable = FunctionReturningArray leaving the variable as a variant works, but hogs memory. i tried "dim variable(0 to 5) as string", but this does not work. -- TheIrishThug ------------------------------------------------------------------------ TheIrishThug's Profile: http://www.excelforum.com/member.php...o&userid=29682 View this thread: http://www.excelforum.com/showthread...hreadid=495039 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
arrays
Since parameters are passed to subroutines and functions by reference
you can simply pass the array as parameter. I believe this will work for any data type. See the following example. Option Explicit Sub Test() Dim dblArray(5) As Double PopulateArray dblArray MsgBox dblArray(2) End Sub Private Function PopulateArray(inArray() As Double) Dim i As Integer Dim x As Double x = 1# For i = 0 To 5 inArray(i) = x x = x + 1# Next End Function *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Avg Arrays | Excel Worksheet Functions | |||
About Arrays | Excel Programming | |||
arrays again | Excel Programming | |||
Arrays | Excel Programming | |||
ARRAYS | Excel Programming |