I have 2 workbooks. Book_A and Book_B.
I want to remove blank lines in the worksheet Book_A1, from the worksheet Book_B1.
I wrote code using VBA to remove blank lines.
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
This code works and allows me to delete blank lines from the worksheet.
Say I have lines in Book_A, workheet1 using the vba editor,
i insert the module for the VBA Book_A project and enter the encoding,
and run the macro,
empty lines in Book_A, workheet1 are deleted.
.................................................. ..........................
** A: This code will not allow me to delete empty lines in the worksheet Book_A1, from the worksheet Book_B1.
I want to remove blank lines in the worksheet Book_A1, from the worksheet Book_B1.
How can I do that? How to change your encoding? **