[FONT=Comic Sans MS]I have the following code and I want to extract the RSquared value off the chart to do futher calculations. Any idea's on how to do this?
Code
'Make Scatter plot chart for sheet 'Load Power'
Sheets("Load Power").Select
Charts.Add
ActiveChart.ChartType = xlXYScatter
ActiveChart.SetSourceData Source:=Sheets("Load Power").Range( _
"D2:D5200,E2:E5200"), PlotBy:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Load Power"
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Load Power"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Load Power"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Delta Gram"
End With
ActiveChart.SeriesCollection(1).Trendlines.Add(Type:=xlLinear, Forward:=0, _
Backward:=0, DisplayEquation:=False, DisplayRSquared:=True).Select
ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.Left = 361
Selection.Top = 282
Display More
Thank you,
Brian G