Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Functions with multiple inputs?

I couldn't make a function with a matrix as input. My idea is to write a
macro (a function in VBA for Excel) witch reeds a matrix (of variable size)
and develops a number. The problem is that I can't find the way to write the
function with multiple inputs (like the function SUM(A1:A5) )

Does anyone knows how to do that?

Nicholas

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Functions with multiple inputs?

Hi Nicholas,

Function Testa(RangeA as Range) as Double

What do you want the function to do?
Maybe this example function is af help to you

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

================================================== ========
Function VLookupSort(SearchArgument As Range, SearchTable As Range, _
ColumnNo As Long, Optional SortDirection, Optional NotFound)
' Works as Vlookup, exact match (4th argument = FALSE)
' But takes advantage of the fact that a table is sorted
' and thus is much faster
' Also permits table to be sorted descending (Sortdirection -1)
' Optional argument for return value if item not found, defaults to #NA
Dim ItemFound

If IsMissing(SortDirection) Then SortDirection = 1

ItemFound = Application.Match(SearchArgument, Intersect(SearchTable, SearchTable.Cells(1).EntireColumn), _
SortDirection)
If SearchTable(ItemFound, 1) < SearchArgument Then
If IsMissing(NotFound) Then
VLookupSort = CVErr(xlErrNA)
Else
VLookupSort = NotFound
End If
Else
VLookupSort = _
SearchTable(ItemFound, ColumnNo)
End If
End Function
================================================== ========

"Nicolas" wrote in message ...
|I couldn't make a function with a matrix as input. My idea is to write a
| macro (a function in VBA for Excel) witch reeds a matrix (of variable size)
| and develops a number. The problem is that I can't find the way to write the
| function with multiple inputs (like the function SUM(A1:A5) )
|
| Does anyone knows how to do that?
|
| Nicholas
|


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Functions with multiple inputs?

Finally I could write the macro as a Function.
I don't have to use the Sub anymore.
Thank you very much.


En del 2/12/06 15:27, "Niek Otten"
escribió:

Hi Nicholas,

Function Testa(RangeA as Range) as Double

What do you want the function to do?
Maybe this example function is af help to you


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Functions with multiple inputs?

You could just have one input variable - try using a Collection and the
calling method can populate it with whatever you need in it. You can
then process through it using For...Next logic.



Nicolas wrote:
I couldn't make a function with a matrix as input. My idea is to write a
macro (a function in VBA for Excel) witch reeds a matrix (of variable size)
and develops a number. The problem is that I can't find the way to write the
function with multiple inputs (like the function SUM(A1:A5) )

Does anyone knows how to do that?

Nicholas


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
Multiple inputs on a spreadsheet BE Excel Discussion (Misc queries) 1 May 23rd 08 12:03 AM
Multiple inputs one output Chris W via OfficeKB.com Excel Discussion (Misc queries) 1 August 25th 05 07:00 PM
Define inputs and outputs to make functions from sheets Prophet of Nixon Excel Discussion (Misc queries) 1 January 10th 05 05:16 PM
how do i have multiple inputs and 1 output Neil[_14_] Excel Programming 3 August 27th 04 06:45 PM
Using Range inputs in functions Curare[_4_] Excel Programming 2 February 26th 04 11:01 AM


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