How do I need to modifyt my existing code???

rkol297

Board Regular
Joined
Nov 12, 2010
Messages
131
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I need to modify the code below so that if any of the values X,Y,Z,A,B,C...etc are present in any of the columns C,D,E,F,G,H do not delete the row. But if NONE of the values X,Y,Z,A,B,C...etc are present in C,D,E,F,G,H then delete entire row?

Rich (BB code):
Dim CelIGMEDCO0F As Range, RngIGMEDCO0F As Range, iIGMEDCO0F As Long
Set RngIGMEDCO0F = Columns("I").SpecialCells(xlConstants, xlTextValues)
    For iIGMEDCO0F = RngIGMEDCO0F.Count To 2 Step -1
        Select Case UCase(Trim(Range("E" & iIGMEDCO0F).Value))
            Case "X", "Y", "Z", "A", "B", "C"    
            'do nothing
            Case Else
                Rows(iIGMEDCO0F).Delete
            End Select
Next iIGMEDCO0F
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Not a duplicate I have my old code on this thread
 
Upvote 0

Forum statistics

Threads
1,203,326
Messages
6,054,748
Members
444,748
Latest member
knowak87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top