Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing Array to function
Hi All,
I have defined the following variables type: Type XXX Var1 as double Var2 as double End Type Public XYZ(10) as XXX How can I pass the array XYZ to a function? Funcationname(XYZ ) doesn't seems like working Thanks. -- Gian |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing Array to function
Thanks SteAXA. I know what I did wrong.
-- Gian "SteAXA" wrote: I try this: Type XXX Var1 As Double Var2 As Double End Type Public XYZ(10) As XXX Sub macro_1() XYZ(0).Var1 = 11 XYZ(0).Var2 = 12 XYZ(1).Var1 = 21 XYZ(1).Var2 = 22 XYZ(2).Var1 = 31 XYZ(2).Var2 = 32 TryToPass XYZ End Sub Function TryToPass(ByRef aaa() As XXX) Dim ncount As Integer Dim Toshow ncount = 0 While Not (ncount 10) Toshow = aaa(ncount).Var1 & " " & aaa(ncount).Var2 MsgBox Toshow ncount = ncount + 1 Wend End Function It seems to work well, maybe i don't understand your problem. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Passing Array to function
That's ok, good work!
Ste' |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Passing array elements to a function | Excel Programming | |||
Passing indexed array value to VBA function | Excel Programming | |||
Passing array from Access to Excel function | Excel Programming | |||
Passing array of strings from DLL function to VBA | Excel Programming | |||
Passing array to a function | Excel Programming |