Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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   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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete rows with specific text David New Users to Excel 5 April 3rd 23 07:29 PM
Delete Rows Without Specific Text waggett Excel Worksheet Functions 6 October 6th 09 11:34 AM
Delete Rows With Specific Text Sean Excel Programming 1 August 19th 06 03:47 PM
Delete rows with numeric values, leave rows with text GSpline Excel Programming 5 October 11th 05 12:44 AM
Delete rows with specific text MAYDAY[_3_] Excel Programming 8 June 7th 05 08:38 PM


All times are GMT +1. The time now is 02:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"