J
JE McGimpsey
Assuming the formula is a trendline on a graph, you can use this User
Defined Function:
Public Function DisplayEquation(Optional nSeries As Long = 1, _
Optional nChart As Long = 1)
Application.Volatile
DisplayEquation = Application.Caller.Parent. _
ChartObjects(nChart).Chart.SeriesCollection(nSeries). _
Trendlines(1).DataLabel.Text
End Function
If you're not familiar with UDF's see
http://www.mvps.org/dmcritchie/excel/getstarted.htm
and call it from the worksheet as
=DisplayEquation()
for one chart, one series, or, for series 2 of chart 3:
=DisplayEquation(2, 3)
Note that you may need to force a calculation to cause the display to
update.
Defined Function:
Public Function DisplayEquation(Optional nSeries As Long = 1, _
Optional nChart As Long = 1)
Application.Volatile
DisplayEquation = Application.Caller.Parent. _
ChartObjects(nChart).Chart.SeriesCollection(nSeries). _
Trendlines(1).DataLabel.Text
End Function
If you're not familiar with UDF's see
http://www.mvps.org/dmcritchie/excel/getstarted.htm
and call it from the worksheet as
=DisplayEquation()
for one chart, one series, or, for series 2 of chart 3:
=DisplayEquation(2, 3)
Note that you may need to force a calculation to cause the display to
update.