Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Conditional Delete Statement | Excel Worksheet Functions | |||
Conditional delete (reposting). | Excel Discussion (Misc queries) | |||
Conditional delete | Excel Discussion (Misc queries) | |||
delete conditional formatting via macro | Excel Discussion (Misc queries) | |||
Conditional Delete | New Users to Excel |