return of function values in Excel
return of function values in Excel
(OP)
I would like to know if it is possible to get 2 or 3 values from the same function that was generated in the VBA Editor from Excel.
If it is, how could i do it?
If it is, how could i do it?





RE: return of function values in Excel
RE: return of function values in Excel
DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.
RE: return of function values in Excel
Your function should return an array of values, so it's going to be an array function. For example:
Public Function test() As Variant
test = Array(1, 2, 3)
End Function
To retrieve the test values in the spreadsheet select cells
A1:C1, then type =test() and press Ctrl-Shift-Enter.
RE: return of function values in Excel
If you stay within VB, the correct way for returning multiple values is to declare the function as returning a user defined type (a 'structure').
prex
motori@xcalcsREMOVE.com
http://www.xcalcs.com
Online tools for structural design