
NameIsAuto true if Microsoft Excel automatically determines the name of the trendline. Name returns or sets a String value representing the name of the object. InterceptIsAuto true if the point where the trendline crosses the value axis is automatically determined by the regression. Intercept returns or sets the point where the trendline crosses the value axis. Index returns a Long value that represents the index number of the object within the collection of similar objects. Setting this property to True automatically turns on data labels.įorward2 returns or sets the number of periods (or units on a scatter chart) that the trendline extends forward. Setting this property to True automatically turns on data labels.ĭisplayRSquared true if the R-squared value of the trendline is displayed on the chart (in the same data label as the equation).

Dim trnln As Trendlineįor Each trnln In ActiveChart.FullSeriesCollection(1).Trendlines()ĬlearFormats - Clears the formatting of the object.īackward2 returns or sets the number of periods (or units on a scatter chart) that the trendline extends backward.īorder returns a Border object that represents the border of the object.ĭataLabel returns a DataLabel object that represents the data label associated with the trendline.ĭisplayEquation true if the equation for the trendline is displayed on the chart (in the same data label as the R-squared value). Here is an example of processing the Trendline items in a collection. The following procedures can be used to set variables of type Trendline: Trendlines.Add and Trendlines.Item. Set trnln = ActiveChart.FullSeriesCollection(1).Trendlines(Index:=1)


To use a Trendline class variable it first needs to be instantiated, for example Dim trnln as Trendline The class Trendline represents a trendline in a chart.
