why even bother passing out the number of outputs? let the first output be a vector X[X] = function(arg1, arg2, arg3, ...)where X = [x1 x2 x3 ...] and so on, let the mechanics inside function construct X, VBA can pull out the vector X and determine its size then.