Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 553
Default Unlimited # of arguments in a UDF

How to declare the number of arguments to be unlimited and optional, as if
selection of a number of range / cells or insert numbers as if in the
function of =SUM()?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 449
Default Unlimited # of arguments in a UDF

Hi Faraz

See if this gets you started:

Public Function myFunction(ParamArray vals() As Variant) As String
Dim L As Long
For L = LBound(vals) To UBound(vals)
myFunction = myFunction & TypeName(vals(L)) & ", "
Next
End Function

Sub Test()
Dim S As String
S = myFunction(Range("A1:C5"), 45, 12.5, "Faraz")
MsgBox S
End Sub

HTH. Best wishes Harald



"FARAZ QURESHI" wrote in message
...
How to declare the number of arguments to be unlimited and optional, as if
selection of a number of range / cells or insert numbers as if in the
function of =SUM()?


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
If Statement Unlimited In Excel SyntaxError Excel Discussion (Misc queries) 8 February 16th 07 11:16 PM
how can i make a cell unlimited Moh Excel Discussion (Misc queries) 16 September 25th 06 10:39 PM
unlimited Moh New Users to Excel 1 September 25th 06 02:04 AM
how to set up a worksheet for unlimited entries? musphuss New Users to Excel 2 August 12th 06 04:16 PM
Where can I get UNLIMITED Excel stock qoutes? ZouBCivil Excel Discussion (Misc queries) 2 March 7th 05 04:42 AM


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