title: Adding X-Y plots to an existing chart in VBA
body: <p>I’d like to write visual basic code that adds a “new series” to an existing plot.  I’ve already managed to write the code that will select that data I want to add.  So to complete the operation I did it in excel, recording the following macro:</p>
  
  <pre><code>‘desired data already selected a column of x values and one of y values to be plotted
  Selection.Copy
  Sheets("XVSER").Select
  ActiveSheet.ChartObjects("Chart 3").Activate
  ActiveChart.Paste
  </code></pre>
  
  <p>However, what this recorded macro does not show is I wanted to add the data as a “new series”, even though this option was explicitly selected while recording the macro.  So when I run the macro it does not do the same thing I did will recording it, and adds the data to an existing series instead of creating a new series for it.</p>
  
  <p>Surely there must be a way of specifying in VBA that I’d like a new series.  I just don’t know how, or where to find documentation, and what I found already on stackoverflow, was difficult for me to understand, and seemed to require a different approach, which I’d rather avoid, since I’ve already developed the code to successfully select the data I want, and to select the chart I want to paste it in.</p>