Thread: Delete Rows
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Delete Rows

Sandman

Just the symbol "-" or in combination with other stuff like -12?

Sub delete_rows()
Dim c As Range
With Columns("A")
Do
Set c = .Find("-", LookIn:=xlValues, LookAt:=xlPart, _
MatchCase:=False)
'change xlPart to xlWhole if just looking for "-" alone
If c Is Nothing Then Exit Do
c.EntireRow.Delete
Loop
End With
End Sub

Gord Dibben Excel MVP


On Wed, 21 Apr 2004 16:01:35 -0500, "Sandman" wrote:

Is there a simple Code to delete a row that contains the symbol "-" in a
cell?


Thanks