Hello, ive been using the following code to delete entirely empty rows (only if all the cells in 1 row are empty) within a range in excel 2003.
This code doesnt work in Excel 2010.
Ive read many Threads regarding deleting entire Rows but found nothing that works for what I want to do.
Code:
Sub delete1()
Dim r As Range, rows As Long, i As Long
Set r = ActiveSheet.Range("A1:D220")
rows = r.rows.Count
For i = rows To 1 Step (-1)
If WorksheetFunction.CountA(r.rows(i)) = 0 Then r.rows(i).Delete
Next
End Sub
This code doesnt work in Excel 2010.
Ive read many Threads regarding deleting entire Rows but found nothing that works for what I want to do.