Reputation: 1
Current code assumes 4 series
Sub Macro1()
ActiveChart.FullSeriesCollection(4).Select
ActiveChart.FullSeriesCollection(4).ChartType = xlArea
ActiveChart.FullSeriesCollection(4).AxisGroup = 2
End Sub
Upvotes: 0
Views: 93
Reputation: 8124
As BigBen suggested, you can use the Count property to refer to the last series. Accordingly, your macro can be re-written as follows...
Sub Macro1()
With ActiveChart
With .FullSeriesCollection(.FullSeriesCollection.Count)
.ChartType = xlArea
.AxisGroup = 2
End With
End With
End Sub
Upvotes: 1