Trendlines Method

Microsoft Excel Visual Basic

Trendlines Method

       

Returns an object that represents a single trendline (a Trendline object) or a collection of all the trendlines (a Trendlines collection) for the series.

object.Trendlines(Index)

object   Required. The Series object.

Index   Optional Variant. The name or number of the trendline.

Example

This example adds a linear trendline to series one in Chart1.

Charts("Chart1").SeriesCollection(1).Trendlines.Add Type:=xlLinear