Trendline

R

Reinfried Englmair

I use to add trendline:

Sub AddTrendline()
Dim serSeries1
' Set a variable to the first series in the first
' chart of cspace.
Set serSeries1 = cspace.Charts(0).SeriesCollection(0)
' Add a trendline to the series.
serSeries1.Trendlines.Add
' Hide the R Squared value for the trendline.
serSeries1.Trendlines(0).IsDisplayingRSquared = False
serSeries1.Trendlines(0).IsDisplayingEquation = False
' color of trendline is RED
serSeries1.Trendlines(0).Line.color = vbRed
serSeries1.Trendlines(0).Type = 1
serSeries1.Trendlines(0).DataLabel.Font.Bold = True
End Sub

You can delete the trendline with:
serSeries1.Trendlines.Delete 0
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top