SeriesCollection(2).Value writes over SeriesCollection(1).Values

Discussion in 'Coding' started by Alberto, Aug 11, 2017.

  1. Alberto


    Aug 11, 2017
    Likes Received:
    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.

    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
    art2.Chart.SeriesCollection(1).Name = "Horas Realizadas(acumulado)"
    Chart2.Chart.SeriesCollection(1).XValues = ActiveSheet.Range("B93:DS93")
    Chart2.Chart.SeriesCollection(1).Values = ActiveSheet.Range("B95:W95")
    Chart2.Chart.SeriesCollection(2).Name = "CdT Actualizado (acumulado)"
    Chart2.Chart.SeriesCollection(2).XValues = ActiveSheet.Range("B93:DS93")
    Chart2.Chart.SeriesCollection(2).Values = ActiveSheet.Range("B99:W99")

    Thank you in advance¡
    Alberto, Aug 11, 2017
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.