title: VBA Paste array of cells between Workbooks at last Populated row (Paste not working?)
body: <p>I am trying to copy an array of data from a csv file to the next available row in a separate workbook in my &quot;PowerBI_table&quot; sheet (starting in column V). When I F8 through the code, no error codes appear, and the information is copied from the csv file -- however it does not paste the data in the workbook. Upon ending the macro, it has the array of cells in the workbook highlighted by they are empty.</p>
  <p>How would you correct this?
  Code below, image attached.</p>
  <pre><code>Sub copyWB2()
  Dim ws1 As Worksheet, ws2 As Worksheet, ws3 As Worksheet
  Dim lastRow_PowerBI_Table As Long
  Dim lastRow_csv_file As Long
  
  
  Set ws1 = Workbooks(&quot;stats.csv&quot;).Sheets(&quot;stats&quot;)
  Set ws2 = Workbooks(&quot;Dig_File.xlsm&quot;).Sheets(&quot;PowerBI_Table&quot;)
  
  lastRow_PowerBI_Table = ws2.Cells(Rows.Count, &quot;V&quot;).End(xlUp).Row
  lastRow_csv_file = ws1.Cells(Rows.Count, &quot;A&quot;).End(xlUp).Row
  
  ws1.Activate
  If IsEmpty([A2]) = False Then
  ws1.Range(&quot;A1:G&quot; &amp; lastRow_csv_file).Copy ''' pick up here
  ws2.Range(&quot;V&quot; &amp; lastRow_PowerBI_Table).PasteSpecial Paste:=xlPasteFormats
  Workbooks(&quot;stats.csv&quot;).Close SaveChanges:=False
  Else: MsgBox (&quot;Error...This Workbook is Empty&quot;)
  Workbooks(&quot;stats.csv&quot;).Close SaveChanges:=False
  End If
  End Sub
  </code></pre>
  <p><a href="https://i.stack.imgur.com/XvSzN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XvSzN.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/WHTIv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WHTIv.png" alt="enter image description here" /></a></p>