Hello I have a little question for adding data to an existing chart.
Now I have a worksheet containing a data series with months for the years in the 2nd row of the sheet. So the months are for example B2 1.2017, C2 2.2017, and in the rows 3,4,5,6,7 and 8 there is always data for that month.
Now I just want my macro to add the new Month plus the data of the rows below to my existing chart.
the code I have so far is this:
Worksheets("Summary").ChartObjects("Chart").Activate
ActiveChart.SeriesCollection.Add _
Source:=Worksheets("Summary").Range("B2:B8")
now this does just create new data series but there is actually no new data added to the chart.
Best Answer
The code below might seem a little long, but it's the safest way to add a new
Series
with Data to an existing Chart.I'm setting all the necessary
Objects
so the code will be as "safe-proof" as can be.Code
Edit 1: to modify existing
Series
data, use something like the code below :