I have a dataset that has 38 variables over 4 sheets. I want to produce trendline charts for each of these variables across the 4 sheets.
Sub CreateChart_Ex1()
'works, proivdes a chart with: =SERIES(Spring!$A$4,Spring!$B$1:$P$1,Spring!$B$4:$P$4,1)
Set WS = Worksheets("Spring")
WS.Activate
WS.Range("A1:P1, A4:P4").Select
WS.Shapes.AddChart2(227, xlLine).Select
'why doesn't this loop work? provides a chart with =SERIES(,,Spring!$A$1:$P$1,1)
For i = 4 To 38
WS.Activate
WS.Range("A1:P1, Ai:Pi").Select
WS.Shapes.AddChart2(227, xlLine).Select
ActiveChart.ChartArea.Copy
Sheets("Graphs").Select
ActiveSheet.Pictures.Paste.Select
Sheets("Spring").Select
Next i
End Sub
The for loop does not produce a chart with data. It looks like it gets lost when it tries to compute "A1:P1, Ai:Pi".
How could I produce all 38 graphs?
Also how can I paste the graphs after one another instead of on top of each other?