Hi everyone,
can anyone out there help me with this code.
I am trying to write a loop in order to get all names of the series automatically. But it does not work!!!
Here the code from excel for two examples... The problem I have to do this for hundreds of them.
Code
Sub NewSeriesNames1
ActiveSheet.ChartObjects("Chart 8").Activate
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).Name = "='Sheet2'!$B$1"
ActiveChart.SeriesCollection(1).XValues = "='Sheet2'!$B$2"
ActiveChart.SeriesCollection(1).Values = "='Sheet2'!$B$3"
ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(2).Name = "='Sheet2'!$C$1"
ActiveChart.SeriesCollection(2).XValues = "='Sheet2'!$C$2"
ActiveChart.SeriesCollection(2).Values = "='Sheet2'!$C$3"
ActiveChart.Legend.Select
ActiveChart.SetElement (msoElementLegendNone)
End Sub
Display More
Thanks in advance.