Excel: Returning a Horizontal Array from a Function Macro

ID: Q62278


The information in this article applies to:


SUMMARY

When a function macro computes more than one value, the computed values may be returned as an array.

Because of function macro limitations and the strict order of calculation followed for macro sheets, it is difficult to arrange computed values horizontally. This can be done with multiple GOTO statements in the macro, but it is more convenient to return the values as a vertical array. A sample RETURN statement might appear as follows:


   =RETURN(A12:A15) 


On the worksheet, however, it is sometimes desirable to horizontally enter the results computed by a function macro. This can be done with the TRANSPOSE function as follows:

  1. Select the appropriate number of cells in a row and type a formula of the following form:

    =TRANSPOSE(Macrosheet!functionmacro(arg1,arg2,...))


  2. Press COMMAND+ENTER to enter the formula as an array. The vertical array returned by the function macro will be entered along the row.


Additional query words: 1.0 1.00 1.03 1.04 1.06 1.5 1.50 2.20 3.0 4.00


Keywords          : 
Version           : 
Platform          : 
Issue type        : 

Last Reviewed: March 21, 1999