Trendline.DisplayEquation property (Excel)

True if the equation for the trendline is displayed on the chart (in the same data label as the R-squared value). Setting this property to True automatically turns on data labels. Read/write Boolean.

Syntax

expression.DisplayEquation

expression A variable that represents a Trendline object.

Example

This example displays the R-squared value and equation for trendline one on Chart1. The example should be run on a 2D column chart that has a trendline for the first series.

With Charts("Chart1").SeriesCollection(1).Trendlines(1) 
 .DisplayRSquared = True 
 .DisplayEquation = True 
End With

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.