Conditional row delete

  • Thread starter Thread starter Penny
  • Start date Start date
P

Penny

I need help writing a macro to remove rows from a large
spreadsheet where the cells in columns E# - AI is blank.
All 31 cells on the row must be blank before the entire
row can be removed. Columns A# - D# will always have
values. The spreadsheet has approximately 2300 rows to
search.

Thanks,
Penny
 
Slightly edited one of John Walkenbach's will hopefully do it.

Sub DeleteEmptyRows()
lastrow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Application.ScreenUpdating = False
For r = lastrow To 1 Step -1
If Application.CountA(Cells(r, 5).Resize(1, 31)) = 0 Then Rows(r).Delete
Next r
End Sub
 
Back
Top