title: Copying content of one spreadsheet into another
body: <p>I have 2 different excel files, stored in C:\Test:</p>
  <ol>
  <li>Book1.xlsx, with Sheet1 (data in the Sheet1 is changing, not constant data-range, but always starts from A1 cell)</li>
  <li>Book2.xlsm, with Sheet2 (empty)</li>
  </ol>
  <p>Every time after opening Book2, I need data from Sheet1 of Book1 to be automatically copied into Sheet2 of Book2.</p>
  <p>Update:
  I tried the following vba code (researched online from Excel Forum)</p>
  <pre><code>     Private Sub Workbook_Open()
  
       Application.EnableEvents = False
       Dim swb As Workbook, Lr As Long, LC As Long, sws As Worksheet
       Dim dCell As Range, srg As Range, dwb As Workbook, dws As Worksheet
       Set swb = Workbooks.Open(&quot;C:\Test\AAA\Book1.xlsx&quot;)
       Set sws = swb.Worksheets(&quot;Sheet1&quot;)
       Lr = sws.Cells(Rows.Count, 1).End(xlUp).Row
       LC = sws.Cells(1, Columns.Count).End(xlToLeft).Column
       Set srg = sws.Range(Cells(1, 1), Cells(Lr, LC))
       Set dwb = ThisWorkbook
       Set dws = dwb.Worksheets(&quot;Sheet2&quot;)
       Set dCell = dws.Range(&quot;A1&quot;)
       srg.Copy dCell
       swb.Close SaveChanges:=False
       dwb.Save
       Application.EnableEvents = True
  
      End Sub
  </code></pre>
  <p>But, the problem with this - that if I delete a few records after the 1st one from Sheet1 of Book1, then - these deleted records still appear in the Sheet2 of Book2!</p>
  <p>I am not great in vba, it's just a part of my whole project
  Sorry for these questions</p>
  <p>Update 2:</p>
  <p>When I have the following in Sheet1, Book1:</p>
  <p><a href="https://i.stack.imgur.com/oJSeb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oJSeb.png" alt="enter image description here" /></a></p>
  <p>Then, after opening Sheet2, Book2, I see (which is correct, what I expected):</p>
  <p><a href="https://i.stack.imgur.com/qSnRs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qSnRs.png" alt="enter image description here" /></a></p>
  <p>But, if I'll delete records in Sheet1, Book1 (starting from the 2nd):</p>
  <p><a href="https://i.stack.imgur.com/sSahF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sSahF.png" alt="enter image description here" /></a></p>
  <p>Then, after opening Sheet2, Book2 I will still see those deleted from Book2 records (while I expect them to be gone):</p>
  <p><a href="https://i.stack.imgur.com/3e9oq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3e9oq.png" alt="enter image description here" /></a></p>