Delete Row Macro

D

Douglas Goodman

Hello
I have a sheet of approx 200 rows that is updated monthly from MS Money.
Could anybody advise a macro to delete rows with a specific cell value of
zero? ie if E*=0,delete row
Thanks very much
Doug
 
K

keri

Doug,

Sub deleterowswithblankcells()
Dim cell As Range

Sheets("sheet1").Activate 'replace sheet1 with your sheet name
For Each cell In ActiveSheet.Range("A1:E20") 'replace A1:E20 with
your range
If cell.Value = 0 Then
ActiveSheet.Rows(cell.Row).Delete (xlUp)
End If
Next
End Sub

This should work.If you just want to delete rows with a value of 0 in
column E then change the range to E1:E1000 or whatever.
 

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