Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Returning arrays

I have written a user defined function that returns an array.

I want to insert this function into a cell on my worksheet and have a
specific member of the array appear in the cell.

What is the syntax for the formula in the cell on the worksheet that will
access a specific element in the array returned from my function?

Thanks in advance for your help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Returning arrays

INDEX into it like this

=INDEX(myfunc(A1:A5),3)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Steve" wrote in message
...
I have written a user defined function that returns an array.

I want to insert this function into a cell on my worksheet and have a
specific member of the array appear in the cell.

What is the syntax for the formula in the cell on the worksheet that will
access a specific element in the array returned from my function?

Thanks in advance for your help.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Returning arrays

in VB the syntax would be:

OneElement = MyFunc(Whatever)(1)
NextElement = MyFunc(Whatever)(2)
etc.

unfortunately including the trailing element number doesn't work when the
function is used as a cell formula

=MyFunc(Whatever)(1)

What I would do is add an optional Arg to return just the one element desired:

=MyFunc(Whatever,1)



"Steve" wrote:

I have written a user defined function that returns an array.

I want to insert this function into a cell on my worksheet and have a
specific member of the array appear in the cell.

What is the syntax for the formula in the cell on the worksheet that will
access a specific element in the array returned from my function?

Thanks in advance for your help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 200
Default Returning arrays

=INDEX(MyFunction(),3,4) for the array element in the 3d "row", 4th
"column" of the array returned by the function "MyFunction".

Alan Beban

Steve wrote:
I have written a user defined function that returns an array.

I want to insert this function into a cell on my worksheet and have a
specific member of the array appear in the cell.

What is the syntax for the formula in the cell on the worksheet that will
access a specific element in the array returned from my function?

Thanks in advance for your help.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default Returning arrays

I learned something new from you and Bob

"Alan Beban" wrote:

=INDEX(MyFunction(),3,4) for the array element in the 3d "row", 4th
"column" of the array returned by the function "MyFunction".

Alan Beban

Steve wrote:
I have written a user defined function that returns an array.

I want to insert this function into a cell on my worksheet and have a
specific member of the array appear in the cell.

What is the syntax for the formula in the cell on the worksheet that will
access a specific element in the array returned from my function?

Thanks in advance for your help.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default Returning arrays

I learned something from you all. Thank you muchly.

steve


"Charlie" wrote:

I learned something new from you and Bob

"Alan Beban" wrote:

=INDEX(MyFunction(),3,4) for the array element in the 3d "row", 4th
"column" of the array returned by the function "MyFunction".

Alan Beban

Steve wrote:
I have written a user defined function that returns an array.

I want to insert this function into a cell on my worksheet and have a
specific member of the array appear in the cell.

What is the syntax for the formula in the cell on the worksheet that will
access a specific element in the array returned from my function?

Thanks in advance for your help.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning Arrays, emulating standard function behavior algorimancer Excel Programming 6 May 9th 06 01:28 PM
Returning arrays from custom worksheet functions in xll files JacksonRJones Excel Programming 0 March 22nd 06 05:47 PM
Can't figure out passing and returning arrays Dave B[_9_] Excel Programming 3 December 10th 05 12:41 AM
RTD returning arrays Jens Thiel[_2_] Excel Programming 0 February 3rd 05 10:41 PM
application.run for returning arrays levent Excel Programming 3 July 23rd 04 08:01 PM


All times are GMT +1. The time now is 09:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"