Refer to a specific element of a UDF created array in another UDF?

G

Guest

Yesterday I asked about how to create a UDF resulting in an array (one or two
dimensional).

Thanks for the big help, Chip, Dick and Gary''s Student!!

Now I know how to create a UDF returning arrays (one or two dimensional),
which is great and is what I was exactly looking for.

The next question is that how I can refer to the UDF resulted arrays in
another
UDF to do other calculations? Like referring to a specific element in the
array one at a time in another UDF.


Thanks for those having already helped me again and for those going to help
me in advance!!!!!!

Sincerely,
Laurie
 
G

Guest

Once again as easy as one...two...three:

Function laurie() As Variant
v = Array(1, 2, 3)
laurie = v
End Function

Sub main()
Dim s As Variant
s = laurie()
MsgBox (s(0) & s(1) & s(2))
End Sub

you don't even need to Dim s as an array in the main routine.
 
G

Guest

Thank you both!!!

I will look into it.
I guess I am ready to take on the task now.

Thank you all for the very kind help again!!!

Laurie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top