If doesn't contain certain text then delete row.

Distsyst

New Member
Joined
Apr 25, 2013
Messages
2
I have found codes for deleting a row if a column contains a set of letters, but I can't seem to find anything that would delete the row if the column doesn't contain certain text.

Sample data:
*A****B****C****D****E*******F
4/23*james**1hr**r32**RTS_21***9
4/23**Leo***2hr**lpl***RPLN*****23




I am trying to keep all rows that have any of the following text in column E:
RTS_11
RTS_12
RTS_21
RTS_22
RTS_32
RTS_41
RTS_42
RTS_51
RTS_52


Is this possible or will I need to make a macro that deletes if column E contains certain text?
Sorry it looks messy =[
Thank you in advance for any and all help, I really truly appreciate it.
 

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".
Select the column containing the sample data,

Goto Data > filter >select drop down > Text Filter > Contains > Type "RTS"
 
Upvote 0
Welcome to the MrExcel board!

My reading of this is a bit the other way around to vds1.

I think you need to filter column E for "Does not begin with" RTS_
Then delete all the visible rows and remove the AutoFilter.
This can be done quickly and easily without a macro, but of course it could be done with code if needed.
 
Upvote 0
I'm going to put this into action once I get to work today.
I really appreciate your time.

Thank you both so much!
 
Upvote 0
I think his data doesnt really begin with RTS_ :cool:

Maybe you meant "does not contain".
Possibly. The blue text could be interpreted two different ways:
a) The cells contain values like "RTS_11" somewhere within other text, or
b) The cells contain values exactly like the blue cells

I was swayed towards b) by the red text example.

Sample data:
*A****B****C****D****E*******F
4/23*james**1hr**r32**RTS_21***9
4/23**Leo***2hr**lpl***RPLN*****23


I am trying to keep all rows that have any of the following text in column E:
RTS_11
RTS_12
RTS_21
RTS_22
RTS_32
RTS_41
RTS_42
RTS_51
RTS_52
 
Upvote 0

Forum statistics

Threads
1,215,363
Messages
6,124,505
Members
449,166
Latest member
hokjock

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