View Single Post
  #1   Report Post  
david cassain
 
Posts: n/a
Default syntax to refer to a range as an array?

hi all --

simple one for those of you who use formulas or arrays regularly.

In a module I have a public function -- Myfunct( inArray as variant,
inNum as Integer) params a an array and an int
It works fine.

Now I want to call it from a worksheet formula using a range as the
array parameter.
e.g.: =MyFunct(A1:D1,B2)

That formula syntax doesn't errors and Im stuck as to the proper way
to convert a range (A1:D1) to call my function. Ive checked through
the Excel array formula dox, but I don't see how to refer to a simple
range as an array.

this works --- = MyFunct({23,34,25,13},B2)
this doesn't -- = MyFunct({A1:D1},B2)

any hints? tips? thanks.
dave