View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Delete rows on Cell

Sub zero_killer()
Set killrow = Nothing
For Each rr In Selection
If IsEmpty(rr) Then
Else
If rr.Value = 0 Then
If killrow Is Nothing Then
Set killrow = rr
Else
Set killrow = Union(killrow, rr)
End If
End If
End If
Next

If killrow Is Nothing Then
Else
killrow.EntireRow.Delete
End If
End Sub

--
Gary''s Student - gsnu200762


"wal50" wrote:

this group led me to C. Pearson's site and this most helpful macro:

Public Sub DeleteRowOnBlankCell()

On Error Resume Next
Selection.SpecialCells(xlCellTypeBlanks).EntireRow .Delete
ActiveSheet.UsedRange

End Sub

How can I modify this to delete on Cell = 0?
I looked at other postings and they are all limited to specific columns. I
would like to have a general solution so that whichever column is selected is
used.
Thanks in advance,
wal50