View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Creating a User Defined Array Function

Jeff,

It's because it defaults as a 2 dimensional array, and Tom just loaded the
first element of the row dimension. You can transpose it with

=TRANSPOSE(returnarray())

again array entered into say A1:A4

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jeff Mason" wrote in message
...
Thanks Tom. Interestingly, if you select multiple rows in a column for the
array function, the first value of the array is repeated in each cell.

Only
when multiple columns in a row are selected do you see each array value.

Is
there a way to make the function flexible so that the function can occupy
either a row or a column?
"Tom Ogilvy" wrote in message
...
Public Function ReturnArray() as Variant
ReturnArray = Array(1,2,3,4)
End Function


if

=ReturnArray()

is array entered in C2:F2 (as an example), the values 1, 2, 3, 4 are
displayed.
--
Regards,
Tom Ogilvy


"Jeff Mason" wrote in message
...
Hi,

I'm trying to create a function that returns an array of values. I

can't
figure out the code to make this work. Does anyone have any insight?

Your
help would be appreciated.

Jeff