M
mikerr
Hi all,
While I'm comfortable with programming, I'm rusty and I have never see
VBA before.
I'm trying to make a macro that makes a graph with trendline based o
whatever range of numbers I have selected. I guess that means that i
the code below, I want to change the sheet and range references t
whatever is currently selected. Your answer will be appreciated.
Thanks.
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("R
INT").Range("AC12:AC15")
ActiveChart.Location Where:=xlLocationAsObject, Name:="R1 INT"
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Trendlines.Add(Type:=xlLinear
Forward:=0, _
Backward:=0, DisplayEquation:=True
DisplayRSquared:=False).Select
ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.Left = 141
Selection.Top = 1
End Su
While I'm comfortable with programming, I'm rusty and I have never see
VBA before.
I'm trying to make a macro that makes a graph with trendline based o
whatever range of numbers I have selected. I guess that means that i
the code below, I want to change the sheet and range references t
whatever is currently selected. Your answer will be appreciated.
Thanks.
Charts.Add
ActiveChart.ChartType = xlLineMarkers
ActiveChart.SetSourceData Source:=Sheets("R
INT").Range("AC12:AC15")
ActiveChart.Location Where:=xlLocationAsObject, Name:="R1 INT"
ActiveChart.SeriesCollection(1).Select
ActiveChart.SeriesCollection(1).Trendlines.Add(Type:=xlLinear
Forward:=0, _
Backward:=0, DisplayEquation:=True
DisplayRSquared:=False).Select
ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.Left = 141
Selection.Top = 1
End Su