You need to get the coefficients you want from LINEST. If it's a simple straight line, then you can get m & b of the equation y=mx+b by entering =SLOPE(y-values,x-values) (that's m) and =INTERCEPT(y-values,x-values), gives b. These values should match the equation's values and you can get them bu application.worksheetfunction.slope(...)
HTH
Unfortunately it's not a straight line. It's normally a 2nd degree polynomial.
Will the method you gave still work?
Thanks again...Mike
I guess what I'm asking is, is the trendline equation that is displayed an object that I can access with a .text property?
-Mike
I figured it out:
a = Worksheets(1).ChartObjects(1).Chart.SeriesCollection(1).Trendlines(1).DataLabel.Text
Thanks...Mike
Try this:
End Sub
Sub TrendLabel()
ActiveSheet.ChartObjects(1).Activate
With ActiveChart.SeriesCollection(1).Trendlines(1)
.DisplayEquation = True
.DisplayRSquared = False
.DataLabel.NumberFormat = "#,##0.0000000"
Worksheets("Sheet1").Range("d1").Value = .DataLabel.Text
.DisplayEquation = False
.DisplayRSquared = True
.DataLabel.NumberFormat = "#,##0.0000000"
Worksheets("Sheet1").Range("d2").Value = .DataLabel.Text
End With
End Sub