title: VBA - Setting counter in loop to copy/paste to next column in master sheet
body: <p>apologies as this might not be the most technical question. </p>
  
  <p>I have been experimenting with this code to try and copy and paste a specified range ("de:e130") into a column in a master sheet and for each subsequent file to copy and paste into the next column. i have managed to get the below which seems to open up and files and pastes only into the one column as opposed to pasting in a subsequent column. I think a loop needs to be integrated in the structure to tell the copy/paste to paste into the next subsequent column in the master sheet. </p>
  
  <p>Kind of stuck , any help would be greatly appreciated. current code below</p>
  
  <pre><code>Sub LoopThroughFolder()
  
      Dim MyFile As String, Str As String, MyDir As String, Wb As Workbook
      Dim Rws As Long, Rng As Range
      Dim a As Integer
      Set Wb = ThisWorkbook
  
  
      MyDir = "L:\Research\Research project\potato\"
      MyFile = Dir(MyDir &amp; "*.xlsx")
      ChDir MyDir
      Application.ScreenUpdating = False
      Application.DisplayAlerts = False
  
  
  
      Do While MyFile &lt;&gt; ""
  
          Workbooks.Open (MyFile), UpdateLinks:=False
  
          With Worksheets("Sheet Guidelines")
  
              Rws = .Cells(Rows.Count, "A").End(xlUp).Row
              Set Rng = Range("D1:E130")
  
              Rng.Copy Wb.Worksheets("Sheet1").Cells(1, 1).End(xlUp).Offset(1, 1)
  
              ActiveWorkbook.Close True
          End With
          MyFile = Dir()
      Loop
  
  End Sub
  </code></pre>