Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 8
Default Returning an Array from a called function within a macro

How do I get a function to return an array. [I know that it should be
doable since the various matrix functions return an array.]

To be more precise I need to do this within a macro. I know how to do
it at the spreadsheet level.

I am running Excel 2004 on a MAC [OSX]

Thanks
Brujolito

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 4,624
Default Returning an Array from a called function within a macro

One way:

Public Function foo() As Variant
foo = Array(1,2,3,4,5)
End Function

You can then array-enter the function into, say A1:E1,

=foo()

to get the values 1-5 into those cells, or use

=SUM(foo()) === 15

You can obviously get much more complicated...


In article om,
" wrote:

How do I get a function to return an array. [I know that it should be
doable since the various matrix functions return an array.]

To be more precise I need to do this within a macro. I know how to do
it at the spreadsheet level.

I am running Excel 2004 on a MAC [OSX]

Thanks
Brujolito

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
index match array function-returning only first match, need last. Julie Olsen Excel Worksheet Functions 3 December 29th 06 12:50 AM
Returning an array from the INDEX function Agenor Excel Worksheet Functions 2 November 28th 06 12:44 AM
What is this function called?? jPaulB Excel Discussion (Misc queries) 3 August 4th 06 08:33 PM
Function, dont know what its called Michael Excel Worksheet Functions 1 May 8th 06 09:47 PM
Macro with Array Function Problems Brett Excel Worksheet Functions 5 January 10th 06 09:50 PM


All times are GMT +1. The time now is 06:12 PM.

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"