Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User function for returning several results

I'm creating an Excel add-in with functions to access a database. I'v
got no problem returning one value, but I don't know how to return
resultset containing more than one instance like an array.

Example:

User calls: =Analysis("12/04/2004")

And Excels returns (to the cell which the function was called) all th
the analysis on the date based on mye resultset like this:

12,4
11,2
10,1

My main problem is returning several values and displaying them.

I've seen some examples using transpose, but I'm not sure how to us
it.

Many thanks in Advance

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default User function for returning several results



If your function returns an array of data ALL that data will be in the
cell unless you've called it from an 'arrayformula'

If you enter the function in your sheet as follows:

select a1:f10
in a1 type =Analysis("12/04/2004") then press CTRL-SHIFT-ENTER

you'll see {} around the formula, and you should see some more data in
your sheet... and probably quite a few Errors values too...

there are tricks so that the function returns an array of the same size
as the calling "array formula"

your function has to redim it's result array to the size of
application.caller.currentarray, and make sure it doesnt return
array elements as empty or 0 but as vbnullstring.





keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


briansol wrote:

I'm creating an Excel add-in with functions to access a database. I've
got no problem returning one value, but I don't know how to return a
resultset containing more than one instance like an array.

Example:

User calls: =Analysis("12/04/2004")

And Excels returns (to the cell which the function was called) all the
the analysis on the date based on mye resultset like this:

12,4
11,2
10,1

My main problem is returning several values and displaying them.

I've seen some examples using transpose, but I'm not sure how to use
it.

Many thanks in Advance.


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default User function for returning several results

Thanks for your help

--
Message posted from http://www.ExcelForum.com

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
User Defined Function returning #Value! DogLover Excel Worksheet Functions 4 November 25th 09 07:31 PM
Returning Desired Results Wavmaster Excel Discussion (Misc queries) 5 September 9th 09 01:31 AM
Vlookup Returning Same Results on Each Row tlatta Excel Discussion (Misc queries) 0 December 14th 05 07:34 PM
Vlookup Returning Same Results on Each Row Kleev Excel Discussion (Misc queries) 0 December 14th 05 07:33 PM
Returning VBA results to a cell JasonSelf[_2_] Excel Programming 2 January 24th 04 05:28 PM


All times are GMT +1. The time now is 11:30 PM.

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

About Us

"It's about Microsoft Excel"