title: Open an Excel file with MS Access VBA and move the data from one sheet to another sheet
body: <p>I am new to VBA Excel Access. I have created a macro-command button in Access data-based that should open an excel file and move data from sheet1 to sheet2. Now when data moves on to sheet2 it should add a remark in column c as updated. However, in sheet2 there is a data already existing, hence it should paste the data below the existing data in sheet2.
  Excel sheet1</p>
  <p>In this sheet 2 already data is existing. Now my macro should paste the data below the existing data in sheet2</p>
  <p>I am getting multiple errors
  This macro I have created in Access VBA because I already have one macro there to export data from access to excel file.
  In this below I want my macro to move the data from sheet 1 to sheet2 and in sheet2 it should paste the data below exiting data with status as updated.</p>
  <p>Please help.</p>
  <p>My Codes: -</p>
  <pre><code>Option Compare Database
  Option Explicit
  
  Private Sub UpdateXL()
  
  Dim xl As Excel.Application
  Dim wb As Excel.Workbook
  Dim wr As Excel.Worksheet
  Dim ws As Excel.Worksheet
  Dim LastRow As Long
  Dim i As Long
  Dim lr As Long
  
  Set xl = CreateObject(&quot;Excel.Application&quot;)
  
  Set wb = xl.Workbooks.Open(&quot;C:Destination.xlsm&quot;)
  
  Set wr = wb.Worksheets(&quot;Sheet1&quot;)
  
  Set ws = wb.Worksheets(&quot;Sheet2&quot;)
  
   
  
      'Copies then cuts the data from Sheet1&quot; and paste the same in sheet2
     
      With wr
          'LastRow = .Cells(.Rows.Count, 1).End(xlUp).Row
          
          lr = wr.Cells(Rows.Count, 1).End(xlUp).Row + 1
          
          Range(&quot;A2:B&quot; &amp; LastRow).Cut ws.Range(&quot;A2&quot;) 'Cut
          
      End With
      
      LastRow = ws.Range(&quot;A&quot; &amp; Rows.Count).End(xlUp).Row
  
      With ws
      
          LastRow = ws.Range(&quot;A&quot; &amp; Rows.Count).End(xlUp).Row + 1
          For i = 2 To .Cells(.Rows.Count, &quot;B&quot;).End(xlUp).Row
           .Cells(i, &quot;B&quot;) = Trim(.Cells(i, &quot;B&quot;))
              Select Case .Range(&quot;B&quot; &amp; i)
                  Case &quot;FXV&quot;, &quot;FST&quot;, &quot;FLB&quot;, &quot;FFH&quot;, &quot;FFJ&quot;
                      .Range(&quot;C&quot; &amp; i) = &quot;Updated&quot;
              End Select
          Next i
      End With
      
      
  End Sub
  </code></pre>