Thread: Delete rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Delete rows

Hi,

You didn't say which cell so this deletes the row if the cell in column A is
zero
Right click the sheet tab, view code and paste this in and run it

Sub mersible()
lastrow = Cells(Rows.Count, "A").End(xlUp).Row
For x = lastrow To 1 Step -1
If Cells(x, 1).Value = 0 Then
Rows(x).EntireRow.Delete
End If
Next
End Sub

Mike

"Koz" wrote:

I am trying to delete all rows where the value of one of the cells equals
zero, is there a formula for this?