View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JMay JMay is offline
external usenet poster
 
Posts: 422
Default Delete entire row based on cell content

In a standard module insert:

Sub DeleteRowWith1()
Dim MyRange As Range
Set MyRange = Range("D:D")
For Each c In MyRange
If IsEmpty(ActiveCell.Value) Then
Exit Sub
Else
If c.Value = 1 Then
ActiveCell.EntireRow.Delete
End If
End If
ActiveCell.Offset(1, 0).Select
Next c
End Sub


"PHIL" wrote in message
...
I would like to have a macro run down a column of figures,
deleting rows that contain the number 1. I'm a novice so I
have trouble instructing it to stop when the data ends....

TIA!