Excel blank row deletion

Closed
munni - Nov 25, 2008 at 01:02 AM
 Michael - Feb 17, 2009 at 06:03 AM
Hello,

Can anyone provide the macro code for deleting all the blank rows in all excels in a folder??

thanks...munni

1 reply

Go to Tool > Macro > Visual Basic Editor

Type in the following into the page you want to delete the blank line from

-------------------------------------------------------------------------------------------------------------
Sub DeleteHiddenRows()
Dim iRow As Long

With Application
.Calculation = xlCalculationManual
.EnableEvents = False
.ScreenUpdating = False

With ActiveSheet.UsedRange
For iRow = .Row + .Rows.Count - 1 To .Row Step -1
If Rows(iRow).Hidden Then Rows(iRow).Delete
Next iRow
End With

.Calculation = xlCalculationAutomatic
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
-------------------------------------------------------------------------------------------------------------

Thats it :o)
5