LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Getting my VB custom functions to support usage within an Array Fo

Option Explicit
Public Function Dataset(target As Range)
Dim ar() As Long
Dim index As Long
ReDim ar(1 To target.Count)
For index = 1 To target.Cells.Count
ar(index) = target.Cells(index).Value
Next
Dataset = ar
End Function

on a sheet, I put 1,2,3,4 in D3:D6
in another cell
{=SUM(dataset(D3:D6)) }

the key in the function is that it should return an array of data



"callagga" wrote:


Hi,

Does anyone know how to get VB custom functions (I'm using Excel 2003)
to support usage within an Array Formula?

For example I have the following function:
€¦€¦€¦€¦€¦€¦.
Function Test(cell As Range)
Test = 1
End Function
€¦€¦€¦€¦€¦€¦.

If I use this from within excel within an array formula it does not
work however. For example:

{=SUM(Test(J74:J78))} <== THIS DOES NOT WORK (i.e. it returns 1
instead of 5)

A standard microsoft function does work of course however, e.g.:

{=SUM(LEN(J74:J78))} This works.

Any ideas?

Thanks


--
callagga
------------------------------------------------------------------------
callagga's Profile: http://www.excelforum.com/member.php...o&userid=27049
View this thread: http://www.excelforum.com/showthread...hreadid=465479


 
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
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Custom Array Functions moi Excel Programming 4 July 29th 05 03:05 PM
Custom Array Functions Tim Williams Excel Programming 1 July 28th 05 11:07 AM
custom functions in formula bar Arasch Sajjadi Excel Programming 0 August 7th 03 09:41 AM
custom functions in formula bar Arasch Sajjadi Excel Programming 1 August 6th 03 05:02 PM


All times are GMT +1. The time now is 12:32 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"