Table of contents
Collapse the table of content
Expand the table of content

Trendline Object (PowerPoint)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Represents a trendline in a chart.


A trendline shows the trend, or direction, of data in a series. The Trendline object is a member of the Trendlines collection. The Trendlines collection contains all the Trendline objects for a single series.


Note Although the following code applies to Microsoft Word, you can readily modify it to apply to PowerPoint.

Use Trendlines (Index), where Index is the trendline index number, to return a single Trendline object.

The index number denotes the order in which the trendlines were added to the series. Trendlines(1) is the first trendline added to the series, and Trendlines(Trendlines.Count) is the last one added.

The following example changes the trendline type for the first series of the first chart in the active document. If the series has no trendline, this example will fail.

With ActiveDocument.InlineShapes(1)

    If .HasChart Then

        .Chart.SeriesCollection(1).Trendlines(1).Type = xlMovingAvg

    End If

End With

See also


PowerPoint Object Model Reference

© 2018 Microsoft