LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Multiple IF NOT OR

The following deletes rows where there is no matching text in column B

Dim RowNdx As Long
Dim LastRow As Long

LastRow = Cells(Rows.Count, "B").End(xlUp).Row
For RowNdx = LastRow To 5 Step -1
If Not (Cells(RowNdx, "B").Value = "EB1" Or _
Cells(RowNdx, "B").Value = "EB10" Or _
Cells(RowNdx, "B").Value = "EB11" Or _
Cells(RowNdx, "B").Value = "EB2" Or _
Cells(RowNdx, "B").Value = "EB3" Or _
Cells(RowNdx, "B").Value = "EB8" Or _
Cells(RowNdx, "B").Value = "EB9" Or _
Cells(RowNdx, "B").Value = "EE3" Or _
Cells(RowNdx, "B").Value = "EE6" Or _
Cells(RowNdx, "B").Value = "EF2" Or _
Cells(RowNdx, "B").Value = "EF3" Or _
Cells(RowNdx, "B").Value = "EG2" Or _
Cells(RowNdx, "B").Value = "WR") Then
Rows(RowNdx).Delete
End If
Next RowNdx

Unfortunately I now need to expand the number of criteria considerably
and have come up against the limit.

Grateful for suggestions as to how I can get around this.
--
Robert
 
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 Blank Rows Code - Multiple Worksheets - Multiple Documents BenS Excel Discussion (Misc queries) 3 June 29th 07 12:20 AM
macro: copy multiple workbooks to multiple tabs in single book Michael Excel Programming 0 July 14th 06 04:53 PM
Crteating Multiple GIFS from Multiple Ranges -- need someone to test my code to see why it fails Father Guido[_5_] Excel Programming 4 November 22nd 05 05:28 AM
Crteating Multiple GIFS from Multiple Ranges -- need someone to test my code to see why it fails Father Guido[_5_] Excel Programming 0 November 19th 05 08:00 AM
view multiple files in multiple windows on multiple screens. tcom Excel Discussion (Misc queries) 7 September 15th 05 09:35 PM


All times are GMT +1. The time now is 10:18 AM.

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

About Us

"It's about Microsoft Excel"