title: How to move excel sheets saved in a folder to a new workbook?
body: <p>"C:\Users\New folder\"  in this path I do have 10 workbooks and each has budget tab...I want to move this tab to "code2.xlsm   </p>
  
  <p>My code is this:</p>
  
  <pre><code>Option Explicit
  Sub move_filesinto_masterWB()
  
  
  Dim Myfile As String
  Myfile = Dir("C:\Users\New folder\")
  Dim Masterwb As Workbook
  Set Masterwb = Workbooks("code2.xlsm")
  
  
  Do While Len(Myfile) &gt; 0
  
  Workbooks.Open (Myfile)
  
  Sheets("budget").Select
  Sheets("budget").Copy After:=Workbooks("Code2.xlsm").Sheets(sheets.count)
  
  Myfile = Dir
  Loop
  
  End Sub
  </code></pre>