How can I delete entire rows in Excel that contain certain keywords?
-
For work, I am currently filtering through a long list of items, and I have been filtering them out by CTRL+F finding and replacing the keywords that indicate rows I don't want with a big XXXXXXXXXXXXXX, then going through and deleting those rows. But is there a way to just eliminate any row that contains certain keywords?
-
Answer:
You can try running a macro. 1. Press Alt+F11 to open the visual basic editor 2. On the left side of the window is the project explorer, which lists the worksheets of your workbook. 3. Double click on the worksheet you want to delete the rows from. That will open the code editor. 4. Paste the following code in the code editor: Sub DeleteRows() Const StringToFind As String = "XXXXXXXXXXXXXX" Dim cell As Range For Each cell In Me.UsedRange.Cells If InStr(1, cell.Formula, StringToFind) > 0 Then Me.Rows(cell.Row).Delete Next cell End Sub 5. Replace XXXXXXXXXXXXXX with the actual keyword, keeping it in quotation marks. 6. Click anywhere on this code and press F5.
wing2871... at Yahoo! Answers Visit the source
Other answers
Are those keywords the only ones in their cell? How many different variations of cell are there containing the words? You should be able to sort them, then put the rows together and delete them. Hope that helps.
Diana B
Related Q & A:
- How can I delete my websearch?Best solution by Yahoo! Answers
- How can I delete my friends on Yahoo messenger?Best solution by Yahoo! Answers
- How can i delete the links that posted on my status?it bothers my im to frends.pls help me delete that?Best solution by Yahoo! Answers
- How can I delete my entire inbox on my blackberry curve?Best solution by Yahoo! Answers
- How can I delete my entire 360' yahoo page?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.