Series.Trendlines Method (Excel)
Returns an object that represents a single trendline (a Trendline object) or a collection of all the trendlines (a Trendlines collection) for the series.
Syntax
expression .Trendlines(Index)
expression A variable that represents a Series object.
Parameters
Name |
Required/Optional |
Data Type |
Description |
---|---|---|---|
Index |
Optional |
Variant |
The name or number of the trendline. |
Return Value
Object
Example
This example adds a linear trendline to series one in Chart1.
Charts("Chart1").SeriesCollection(1).Trendlines.Add Type:=xlLinear