Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting Certain Rows
I have a macro that manipulates the data in my spreadsheet. That last thing
I had it do was sort by a certain column. This column contains either blank cells or the number "92". Now I want the macro to delete all the rows that contain the blank cells (which are technically starting on Row 2 (after the header row). How do I get the macro to select and delete up to the row before where the 92's start? Thanks -- Debra Ann |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Deleting Certain Rows
If the cells are really blank, assume column M and M1 is not blank
columns("M").Specialcells(xlblanks).EntireRow.Dele te if you have formulas in the cells that do something like =if(condition,92,"") then you will need to loop for i = cells(rows.count,"A").End(xlup).row to 2 step -1 if cells(i,"M").Value = "" then rows(i).Delete end if Next This assumes column A will have data at least in the last used row (where M might not). change "A" to reflect the column which will satisfy this requirement -- Regards, Tom Ogilvy "Debra Ann" wrote in message ... I have a macro that manipulates the data in my spreadsheet. That last thing I had it do was sort by a certain column. This column contains either blank cells or the number "92". Now I want the macro to delete all the rows that contain the blank cells (which are technically starting on Row 2 (after the header row). How do I get the macro to select and delete up to the row before where the 92's start? Thanks -- Debra Ann |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro for deleting rows and serialising the remaing rows | Setting up and Configuration of Excel | |||
Macro for deleting rows and serialising the remaing rows | Excel Worksheet Functions | |||
Help!! I have problem deleting 2500 rows of filtered rows!!!! | Excel Discussion (Misc queries) | |||
Help!!! I have problem deleting 2500 rows of filtered rows | Excel Programming | |||
deleting hidden rows so i can print only the rows showing?????? | Excel Worksheet Functions |