VBA - Clear empty rows

Post date: Feb 3, 2011 11:27:41 PM

' clear the empty cells

L1 = ActiveSheet.Cells(65536, 1).End(xlUp).Row

L2 = Cells.SpecialCells(xlCellTypeLastCell).Row

Rows(L2).Select

L3 = L1 + 1

Do Until L1 = L2

Range(Cells(L3, 1), Cells(L2, 1)).EntireRow.Select

Selection.EntireRow.Delete

Range("a1").Select

ActiveSheet.UsedRange.Select

L2 = Cells.SpecialCells(xlCellTypeLastCell).Row

Loop