ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   a function that deletes all rows with no value in a certain column? (https://www.excelbanter.com/excel-discussion-misc-queries/448850-function-deletes-all-rows-no-value-certain-column.html)

dunndealpr

a function that deletes all rows with no value in a certain column?
 
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?

Claus Busch

a function that deletes all rows with no value in a certain column?
 
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
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2

Claus Busch

a function that deletes all rows with no value in a certain column?
 
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
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


All times are GMT +1. The time now is 07:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com