Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Simple - Del empties
Hi,
I would like a code to delete empty rows based on column E (row 4 of the table). Using the recorded I apply a filter, use the filter to show the blank cells from col E. At this point I dont know how to ask VB to select the first row in table - it could be any row from 1 to 66500 depending on the contents. How I get it to select the first empty row rather than having to ask it to select a certain row as in the code below? Once selected I want to delete all rows from there to the end. Thanks Sub DELROWS() ' Rows("2:2").Select Selection.AutoFilter Selection.AutoFilter Field:=4, Criteria1:="=" Rows("9:9").Select Range("B9").Activate Range(Selection, Selection.End(xlDown)).Select Range(Selection, Selection.End(xlDown)).Select Selection.delete Shift:=xlUp Selection.AutoFilter Field:=4 Rows("2:2").Select Selection.AutoFilter Range("B1").Select End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VBA empties clipboard | Excel Programming | |||
IF formula-simple question; simple operator | Excel Discussion (Misc queries) | |||
Office Clipboard empties itself when enabling/disabling commandbars | Excel Programming | |||
Simple Simple Excel usage question | Excel Discussion (Misc queries) | |||
Make it more simple or intuitive to do simple things | Charts and Charting in Excel |