Trendline.Type property (Excel)

Returns or sets an XlTrendlineType value that represents the trendline type.

Syntax

expression.Type

expression A variable that represents a Trendline object.

Example

This example changes the trendline type for the first series in embedded chart one on worksheet one. If the series has no trendline, this example fails.

Worksheets(1).ChartObjects(1).Chart _ 
 .SeriesCollection(1).Trendlines(1).Type = xlMovingAvg

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.