View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Getting output from the TREND function using VBA

arrNewY = Application.WorksheetFunction.Trend(knownY, knownX, newXs, const)

knownY, knownX and newXs can refer to cells or arrays made in VBA

arrNewY is an array, even if newXs is a single value, with lower-bound of 1
and qty of elements same as newXs

Regards,
Peter T

"stanleykorn" wrote in message
...
The TREND function has the syntax
TREND(known_y's,known_x's,new_x's,const).
In order to output the array of estimated y values on a spreadsheet, the
Excel Help entry specifies that a range must be selected beginning with
the
cell in which the TREND function is entered and extending downward so that
the number of cells in the range is equal to the number of estimated y
values. The user is then instructed to press F2, and then press
CTRL+SHIFT+ENTER, causing the estimated y values to populate the selected
range. That method works fine for outputting the estimated y values on a
spreadsheet, but how do I output the estimated y values as an array within
a
VBA subprogram?