a function that deletes all rows with no value in a certain column?

D

dunndealpr

Hey all, I use Excel 2007. Can it be set up to delete all rows in a
excel file when there is no value in a certain column? For instance
every row with no value in column H would automatically be deleted
 
C

Claus Busch

Hi,

Am Thu, 6 Jun 2013 20:44:41 +0100 schrieb dunndealpr:
Hey all, I use Excel 2007. Can it be set up to delete all rows in an
excel file when there is no value in a certain column? For instance,
every row with no value in column H would automatically be deleted?

filter column H for empty cells and delete the visible rows.


Regards
Claus Busch
 
C

Claus Busch

Hi,

Am Thu, 6 Jun 2013 21:55:30 +0200 schrieb Claus Busch:
filter column H for empty cells and delete the visible rows.

if you want to do it automatically, then try VBA:

Sub DeleteRows()
Dim LRow As Long

LRow = Cells(Rows.Count, "H").End(xlUp).Row
Range("A1:H" & LRow).AutoFilter Field:=8, Criteria1:="="
Range("A2:H" & LRow).EntireRow.Delete
ActiveSheet.AutoFilterMode = False
End Sub


Regards
Claus Busch
 

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