I am creating a chart but won't always know how many data series I will have...does anyone know how to adjust the code below so that it can account for changes in the number of series?
Code:
ActiveChart.PlotArea.Select
ActiveChart.ChartArea.Select
ActiveChart.SeriesCollection(1).XValues = "='Comparison Analysis Data'!$A$6:$A$" & chartrow - 1
ActiveChart.SeriesCollection(1).Values = "='Comparison Analysis Data'!$B$6:$B$" & chartrow - 1
ActiveChart.SeriesCollection(2).Values = "='Comparison Analysis Data'!$C$6:$C$" & chartrow - 1