Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Rows With Specific Text or Values
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Delete rows with specific text | New Users to Excel | |||
Delete Rows Without Specific Text | Excel Worksheet Functions | |||
Delete Rows With Specific Text | Excel Programming | |||
Delete rows with numeric values, leave rows with text | Excel Programming | |||
Delete rows with specific text | Excel Programming |