Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create array function

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Create array function

10x Tom:)
My mistake... I my situation I put in column not into row:(
Into column situation right usage is {=TRANSPOSE(test())}
Thanks again

Tom Ogilvy wrote:
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)

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
Worksheet Function to Create Array of Size n with values x Through Dial222 Excel Discussion (Misc queries) 1 December 6th 07 11:21 AM
how do I create an array lost Excel Discussion (Misc queries) 6 April 7th 05 12:43 AM
how do I create an array array_deficient Excel Discussion (Misc queries) 0 April 6th 05 09:53 PM
Create Pivot from array? Brian Excel Programming 0 February 16th 04 05:51 PM
Create a PivotTable from a VBA array? Dave[_15_] Excel Programming 0 August 9th 03 12:58 PM


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