macro to delete lines

K

Kevin Depree

Hi,

I want to write a macro that looks in one column of a
page, and if the column has a '0' in it, it deletes the
row.

This would continue until all rows with '0' are deleted.

Anyone help
 
J

John Mansfield

Hi,

Please see the suggestion to your same post in the
Programming group.

John Mansfield
 
I

icestationzbra

Option Explicit

Sub deleteRows()

Dim i As Integer
Dim n As Integer
Dim area

With Sheet1

n = .Range("a1").CurrentRegion.Rows.Count

For i = 2 To n

If (.Range("a" & i).Value = 0) Then

Range("A" & i).EntireRow.Delete

Else

GoTo None

End If

Next i

End With

None:
MsgBox "No rows to delete!"

End Su
 
Top