ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Deleting Rows (https://www.excelbanter.com/new-users-excel/89282-deleting-rows.html)

fak119

Deleting Rows
 
For a Macro novice...

Is there an easy macro that deletes rows when a particular cell has the
value 0 (zero)?

Thank you

Don Guillett

Deleting Rows
 
try
Sub deletezerorows()
Application.DisplayAlerts = False
On Error Resume Next
vlr = Cells(Rows.Count, "d").End(xlUp).Row
With Range(Cells(2, "D"), Cells(vlr, "D"))
.AutoFilter Field:=1, Criteria1:="0"
..SpecialCells(xlCellTypeVisible).Delete
.AutoFilter
End With
Application.DisplayAlerts = False
End Sub

--
Don Guillett
SalesAid Software

"fak119" wrote in message
...
For a Macro novice...

Is there an easy macro that deletes rows when a particular cell has the
value 0 (zero)?

Thank you





All times are GMT +1. The time now is 04:39 PM.

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