Returning Multiple Values from an Excel Function MacroID: Q71946
|
There are two different methods of returning multiple values from an
Excel function macro. One works for returning a variable-sized array
and the other works for returning a fixed-size array.
A1: Multiply_Function
A2: =RESULT(64)
A3: =ARGUMENT("range",64)
A4: {=SET.NAME("result",range*100)}
A5: =RETURN(result)
A1: 5 B1: {=MACRO1.XLS!Multiply_Function(A1:A4)}
A2: 3 B2: {=MACRO1.XLS!Multiply_Function(A1:A4)}
A3: 1 B3: {=MACRO1.XLS!Multiply_Function(A1:A4)}
A4: 2 B4: {=MACRO1.XLS!Multiply_Function(A1:A4)}
A1: 5 B1: 500
A2: 3 B2: 300
A3: 1 B3: 100
A4: 2 B4: 200
A1: Time_Function
A2: =RESULT(64)
A3: =ARGUMENT("start",1)
A4: =ARGUMENT("finish",1)
A5: =HOUR(finish-start)
A6: =MINUTE(finish-start)
A7: =SECOND(finish-start)
A8: =RETURN(A5:A7)
A1: 1:00:00
A2: 6:49:34
A3: {=MACRO1.XLS!Time_Function(A1,A2)}
A4: {=MACRO1.XLS!Time_Function(A1,A2)}
A5: {=MACRO1.XLS!Time_Function(A1,A2)}
A1: 1:00:00
A2: 6:49:34
A3: 5
A4: 49
A5: 34
"Microsoft Excel User's Guide, Book 2." Version 4.0, pages 207-208.
"Microsoft Excel User's Guide." Version 3.0, pages 571-572.
"Microsoft Excel Functions and Macros." Version 2.1x, pages 179-180.
Additional query words: 2.0 2.00 2.01 2.1 2.10 2.2 2.20 2.21 3.0 4.0
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: March 21, 1999