title: delete blank rows on an excel worksheet, in a different excel workbook, using vba
body: <p>I have 2 work books. Book_A and Book_B. </p>
  
  <p>I want to delete blank rows in Book_A worksheet1, from Book_B worksheet1.</p>
  
  <p>I have written a code using VBA to delete blank rows.</p>
  
  <pre><code>Sub RemoveEmptyRows()
  
  ' this macro will remove all rows that contain no data
  
  Dim i             As Long
  Dim LastRow      As Long
  
  LastRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
  Application.ScreenUpdating = False
  
  For i = LastRow To 1 Step -1
  
    If WorksheetFunction.CountA(ActiveSheet.Rows(i)) = 0 Then
     ActiveSheet.Rows(i).EntireRow.Delete
  
  End If
  Next i
  
  Application.ScreenUpdating = True
  End Sub
  </code></pre>
  
  <hr>
  
  <p>This code works and enables me to delete blank rows of a worksheet.</p>
  
  <p>Say i have rows in Book_A, worksheet1,using the vba editor, </p>
  
  <p>i insert a module for VBA project Book_A and type the coding, </p>
  
  <p>and run the macro, </p>
  
  <p>the blank rows in Book_A, worksheet1 get deleted.</p>
  
  <p>............................................................................</p>
  
  <p>**But:
  This code will not enable me to delete blank rows in Book_A worksheet1, from Book_B worksheet1.</p>
  
  <p>I want to delete blank rows in Book_A worksheet1, from Book_B worksheet1.</p>
  
  <p>How can this be done? How do i edit my coding?
  **</p>