locked
How to draw multiple series in graphs using VBA RRS feed

  • Question

  • 'Update Graphs with new data
        ActiveSheet.ChartObjects("choMDyn2DTargetZ").Activate
        ActiveChart.ChartArea.Select
        ActiveChart.SetSourceData Source:=[MDyn2DTargetZ], PlotBy:=xlColumns
        ActiveWindow.Visible = False
       
        ActiveSheet.ChartObjects("31").Activate
        ActiveChart.ChartArea.Select
        ActiveChart.SetSourceData Source:=[MDyn2DLoZ], PlotBy:=xlColumns
        ActiveWindow.Visible = False
       
        ActiveSheet.ChartObjects("choMDyn2DHiZ").Activate
        ActiveChart.ChartArea.Select
        ActiveChart.SetSourceData Source:=[MDyn2DHiZ], PlotBy:=xlColumns
        ActiveWindow.Visible = False




    --- Above is the code through which i am drawing graphs and chars. now above graphs are able to draw only one series, but i wanna draw multiple series in the same graph what should i do.

    Please i need immediate help.
    Monday, September 28, 2009 9:22 PM

Answers

  • Hi,

    If the named ranges used as the Source argument contain multiple columns then the chart should contain multiple series.

    You can also use the NewSeries method of the SeriesCollection object to add more data series.
    Cheers www.andypope.info
    • Marked as answer by Tim Li Monday, October 5, 2009 5:50 AM
    Tuesday, September 29, 2009 7:57 AM