Conditional row delete

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
 
K

Ken Wright

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top