View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 399
Default Delete Rows With Specific Text or Values

Hi, Sean. Try this - but please try it on a COPY of your data first.

Ed

Sub Foo_Test1356()

Dim rng As Range
Dim cll As Range
Dim x As Long

x = 0
Set rng = ActiveSheet.Range("A1:A10000")
For Each cll In rng.Cells
If cll.Text = "----*" _
Or cll.Text = "000*" _
Or cll.Text = "For acct*" Then
cll.EntireRow.Delete
x = x + 1
End If
Next cll

MsgBox "Deleted " & x & " rows."

End Sub

"Sean" wrote in message
...
I always am making posts and asking questions. I appreciate all the help I
always receive. My next one seems fairly easy although I just cant get
it.

I want to delete rows with specified text or values in column "A". Such
as,

If A1:A10000 = "----*" or "000*" or "For acct*" Then entire row delete.

Thanks,

Sean