title: how loop plots in excel vba macro
body: <p>I am trying loop the scatter plot over columns using Excel VBA, but did get idea how to do it.</p>
  
  <p>Here is a dummy data I produced by filling Y series with RAND() function and the figure shows a sample chart I produced. </p>
  
  <p><img src="https://i.stack.imgur.com/TwZGB.jpg" alt="enter image description here"></p>
  
  <p>Here is associated codes:</p>
  
  <pre><code>Sub multichart()
      Range("A1:B21").Select
      Charts.Add
      ActiveChart.ChartType = xlXYScatter
      ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:B21"), PlotBy _
          :=xlColumns
      ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
      With ActiveChart
          .HasTitle = True
          .ChartTitle.Characters.Text = "Y1"
          .Axes(xlCategory, xlPrimary).HasTitle = False
          .Axes(xlValue, xlPrimary).HasTitle = False
      End With
      ActiveSheet.Shapes("Chart 6").ScaleHeight 0.61, msoFalse, msoScaleFromTopLeft
      ActiveChart.PlotArea.Select
      Selection.Top = 1
      Selection.Height = 106
      Selection.Height = 113
      With Selection.Border
          .ColorIndex = 16
          .Weight = xlThin
          .LineStyle = xlContinuous
      End With
      With Selection.Interior
          .ColorIndex = 2
          .PatternColorIndex = 1
          .Pattern = xlSolid
      End With
  End Sub
  </code></pre>
  
  <p>I want to loop this process to create N graphs (where N is number of Y columns in any sheet), means vary from sheet to sheet. Also plots will be appended one after another. Y limits and X limit are intended to be same in all plots for comparison. The output look something like (just showing 4 variables for example):</p>
  
  <p><img src="https://i.stack.imgur.com/89bz9.jpg" alt="enter image description here"></p>
  
  <p>Sorry if this a basic question as I am Excel VBA guest. </p>