title: Replace Excel Worksheet with Sheet from another file with VBA
body: <p>Fairly new to VBA. I am attempting to pull one sheet out of another excel file and place it in the active workbook. I have done so, but I would like to have it set up so that every time I run the code it replaces the old sheet with the new sheet rather than adding an infinite amount of sheets as the program is continued to be used. Any help?</p>
  
  <p>Here is the code I am currently using:</p>
  
  <pre><code>Private Sub CommandButton2_Click()
  
  
      Dim sh As Worksheet, wb As Workbook
  
      Set wb = Workbooks("QI VBA.xlsm")
      For Each sh In Workbooks("Example.xlsx").Worksheets
          If sh.Name = "Sheet1" Then
          sh.Copy After:=wb.Sheets(wb.Sheets.Count)
  
      End If
  Next sh
  
  End Sub
  </code></pre>