Conditional row delete
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 |
Conditional row delete
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 -- Regards Ken....................... Microsoft MVP - Excel Sys Spec - Win XP Pro / XL2K & XLXP ---------------------------------------------------------------------------- Attitude - A little thing that makes a BIG difference ---------------------------------------------------------------------------- "Penny" wrote in message ... 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 |
All times are GMT +1. The time now is 02:29 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com