Trendline.DisplayRSquared property (Word)

True if the R-squared value of the trendline is displayed on the chart (in the same data label as the equation). Read/write Boolean.

Syntax

expression. DisplayRSquared

expression A variable that represents a 'Trendline' object.

Remarks

Setting this property to True automatically turns on data labels.

Example

The following example displays the R-squared value and equation for trendline one of the first chart in the active document. You should run the example on a 2D column chart that has a trendline for the first series.

With ActiveDocument.InlineShapes(1) 
 If .HasChart Then 
 With .Chart.SeriesCollection(1).Trendlines(1) 
 .DisplayRSquared = True 
 .DisplayEquation = True 
 End With 
 End If 
End With 

See also

Trendline Object

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.