I need to be able to specify the plot order of each series based on its name like this:
ActiveChart.SeriesCollection(4).PlotOrder = 1
ActiveChart.SeriesCollection(Series Name).PlotOrder = 1
How would I write line 8 so that the PlotOrder of the series collection with the name of SrzNm would be the value of i?
Dim top As Range, btm As Range, topRw As Long, btmRw As Long, SrzNm As String Set top = [B1].End(xlDown) Set btm = top.End(xlDown) topRw = top.Row - (top.Row - 1) btmRw = btm.Row - [B1].End(xlDown).Row + 1 For i = topRw To btmRw SrzNm = Cells(top.Row + i - 1, 2) 'ActiveChart.SeriesCollection(the PlotOrder number of the series collection named "SrzNm").PlotOrder = i Next ii
From novice to tech pro — start learning today.