View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Excel2000: UDF's parameter as cell range OR array

Use a variant and test its type to find out what kind of parameter has been
used:

If TypeName(Lookup_Columns) = "Range" Or VarType(Lookup_Columns) = vbArray
Then
etc.

the parameter could be a range, a scalar value or a one or two dimensional
array of constants.

regards
Charles
______________________
Decision Models
FastExcel 2.1 now available
www.DecisionModels.com

"Arvi Laanemets" wrote in message
...
Hi

How to create an UDF which can have as parameter either the cell range or
an
array, i.e both syntaxes in examples below will work:

=MyFunction(A2,B2,OtherSheet!$A$2:$A$7)
or
=MyFunction(A2,B2,{2;3;4;5;6;7})


Thanks in advance
--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets