Hi Guys,

I am trying to construct an array in a function and return in but it doesnt work.
for example, the below function contruct an array
Function test()

redim myarray (1 to 5)

dim i

for i=1 to 5
myarray(i)=i
next i

test=myarray
End Function

Then in a sub, I try this


sub mysub()
redim myarray(1 to 5)
myarray=test()
end sub
But it is not working? any idea how I could achieve this?
Thanks