Refer to a specific element of a UDF created array in another
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
"Tom Ogilvy" wrote:
Just to add.
you don't even need to Dim s as an array in the main routine.
No, but it better be a variant; the preferred method is to Dim it as Variant.
--
Regards,
Tom Ogilvy
"Gary''s Student" wrote:
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.
--
Gary''s Student - gsnu200745
"Laurie" wrote:
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
|