View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Create array function

It works for me.

Select C4:E4, go to the formula bar and enter
=Test()
then exit with Ctrl+Shift+Enter

The 3 cells must be in a single row.

If displays 100 50 0

note that A(2) produces a 3 element array, same as Dim A(0 to 2)

--
Regards,
Tom Ogilvy

"Yuriy Kuznetsov" wrote in message
...
How to create worksheet function that return a array into
cells ? This function return only 100 into cells (i put cell as single
or as a arry function (with ctrl+shift+enter)

Function test() As Variant
Dim a(2) As Byte
a(0) = 100
a(1) = 50
test = a
End Function