TLText = pointer = Application.Find('=', TLText) 'CONVERT TRENDLINE TEXT TO AN EXCEL FORMULA
'CHANGE NUMBER FORMAT TEMPORARILY TO GET SUFFICIENT PRECISION TLNumberFormat = Selection.NumberFormat Selection.NumberFormat = '0.0000000000E+00' On Error GoTo BadSelection 'Selection.Name e.g., 'Text S3T1' If Selection.Name Like 'Text S*T*' Then pointer = Application.Find('T', Selection.Name, 3) SeriesNum = Val(Mid(Selection.Name, 7, pointer - 7)) TrendlineNum = Val(Mid(Selection.Name, pointer +1,3)) ElseīadSelection: MsgBox 'You must select a Trendline label.' Exit Sub End If On Error GoTo 0 'REMEMBER LOCATION OF CHART If TypeName( ActiveSheet) = 'Chart' Then ChartSheetName = ActiveSheet.Name Else pointer = Application.Find('Chart', ActiveChart.Name) ChartObjectName = Mid(ActiveChart.Name, pointer, 100) End If 'Tranfers Trendline text to cell as formula. The utility TrendlineToCell provided on the CD-ROM converts the Trendline equation to an Excel formula and transfers the formula to a selected cell on a worksheet. The disadvantage of Trendline is that the trendline equation is merely a caption in the chart to use it in the worksheet, the coefficients must be transferred manually by typing, or copying and pasting.
Trendline provides a limited gallery of mathematical fitting functions, including regular polynomials up to order six. Scientists and engineers often use Excel's Trendline feature to obtain a least-squares fit to data in a chart.