Excel Problem with SeriesCollection().Values

Joined
Aug 11, 2017
Messages
2
Reaction score
0
Hi, I´m having trouble with my code because when the second serie is ploted it has the value of the sume of both series 1 and 2.

This is my code:

Dim Chart2 As ChartObject
Set Chart2 = ActiveSheet.ChartObjects.Add(Left:=10, Width:=1380, Top:=450, Height:=380)
Chart2.Chart.ChartType = xlLineStacked
Chart2.Chart.SeriesCollection.NewSeries
Chart2.Chart.SeriesCollection(1).Name = "Hours"
Chart2.Chart.SeriesCollection(1).XValues = ActiveSheet.Range("B93:S93")
Chart2.Chart.SeriesCollection(1).Values = ActiveSheet.Range("B95:W95)
Chart2.Chart.SeriesCollection.NewSeries
Chart2.Chart.SeriesCollection(2).Name = "CdT"
Chart2.Chart.SeriesCollection(2).XValues = ActiveSheet.Range("B93:S93")
Chart2.Chart.SeriesCollection(2).Values = ActiveSheet.Range("B99:W99)

Thank you in advance¡
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top