Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Laurie - 20 Sep 2007 15:50 GMT
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
Gary''s Student - 20 Sep 2007 16:02 GMT
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.
Signature

Gary''s Student - gsnu200745

> Yesterday I asked about how to create a UDF resulting in an array (one or two
> dimensional).
[quoted text clipped - 14 lines]
> Sincerely,
> Laurie
Tom Ogilvy - 20 Sep 2007 16:10 GMT
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.

Signature

Regards,
Tom Ogilvy

> Once again as easy as one...two...three:
>
[quoted text clipped - 29 lines]
> > Sincerely,
> > Laurie
Laurie - 20 Sep 2007 16:20 GMT
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

> Just to add.  
> > you don't even need to Dim s as an array in the main routine.
[quoted text clipped - 34 lines]
> > > Sincerely,
> > > Laurie
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.