How to Delete Rows in Excel with Specific Text (3 Methods)

We often need to delete rows with specific text in Microsoft Excel. I have explained 3 methods on how to delete rows in Excel with specific text in this article. The methods are super easy to follow.

We are going to use a sample dataset to explain the methods clearly. We’ve taken a dataset of a particular shop where it contains sales information of different locations. The dataset has 3 columns: Name, Location, and Sales.

Delete Rows with Specific Text in Excel


Download Practice Workbook

You can download the Excel file from this link.


3 Ways to Delete Rows with Specific Text in Excel

1. Using Find Feature to Delete Rows with Specific Text

In this section, we will delete all the rows matched with the textAlan“. I will show you deletion for both Partial Matching and Full matching using the Find feature of Excel.


1.1. Delete Rows with Partial Matching Text in Excel

In this, we will delete rows with partial matched text. In our dataset, we have two rows that contain the names “Alan” and “Alan Marsh”. We can use partial matching to remove these two rows.
To do so follow the explained steps.

Steps:

  • From the Home tab go to Find & Select and then click Find.

Delete Rows using Find Feature of Excel

  • Then the “Find and Replacedialog box will appear. Alternatively, you can use CTRL + F to open this.
  • Now type “Alan” in the Find what: box.

  • Click on Find All. Two results will be shown.
  • You need to select those two, by using SHIFT + Click.
  • After selecting, click on Close.

Delete Rows using Find Feature of Excel with Partial Text Matching

  • Right click on any of the selected rows to show the Context Menu bar.
  • Then, select Delete…

  • Select Entire row from the dialog box.
  • Then click on OK.

Delete Rows with Specific Text using Find Feature of Excel

Rows containing the textAlan” are not there anymore.
Finally, you can see the result below.


1.2. Using Find Feature to Delete Rows with Full Matching Text

From the same dataset, we will remove the textAlan” only (not “Alan Marsh”). To do that follow these steps.

Steps:

  • Bring up the Find and Replace dialog box by following the previous method.
  • Select Options>>.

Delete Rows using Find Feature of Excel with Full Matched Text

We will only remove the textAlan”. So we need to –

  • Put a tick in Match entire cell contents.
  • Click on Find All.

Now notice, only row 6 is selected.

  • Select that result.
  • Click on Close.

Delete Rows using Find Feature of Excel with Fully Matched Text

  • Now Right click on that result to bring up the Context Menu.
  • Click on Delete…

  • Select Entire row.
  • Then OK.

Delete Rows using Find Feature of Excel with Specific Text

The result will be like this. Only the row with the text “Alan” will be deleted.
Row with “Alan Marsh” will be intact.

Related Content: How to Delete Multiple Rows in Excel with Condition (3 Ways)


2. Delete Rows with Matching Specific Text Using Filter

We can also use the Excel Filter command to delete rows with matching text. We have a dataset containing the Name, Birth Year, and Height of 10 people.

Delete Rows using Filter Feature of Excel with Specific Text


2.1. Generic Method of Using Filter to Delete Row Containing Specific Text

We will delete the row that contains the textBruce” using the Filter command of Excel.

Steps:

First, We need to enable Excel Filter. To do that:

  • Select the range where you want to apply Filter.
  • We selected the range B4:D14.
  • From the Data tab, select Filter.

We will see three Excel Filter icons appear in the column header.

Delete Row using Filter Feature in Excel with Specific Text

We want to remove the row that contains the textBruce”.

  • Select the Name column and Expand Filter icon.
  • Uncheck (Select All).
  • Check “Bruce”.
  • Then OK.

Row with “Brucewill be shown.

  • Right Click on the row to bring up the Context Menu.
  • Then Delete Row.

Delete Rows Using Filter in Excel

A warning message will appear.

  • Click on OK.

Notice there is nothing. We can bring back the other rows by clearing Filter criteria.

Delete Rows Using Filter Feature in Excel with Specific Text

  • Click on the Filter button of Name Column.
  • Then select Clear Filter From “Name”.

We can see the result. There is no row with the textBruce”.

Delete Rows with Specific Text using Filter


2.2. More Than One Word Matching

If you want you can remove more than two texts by using similar steps. In this method, I’m going to explain it to you.
For example, we want to remove the rows with textGina” alongside withBruce”. For doing so follow these
Steps:


2.3. Delete Rows with Specific Word and Condition

We can remove rows with matching text and criteria too. We have a similar dataset from above. However, this time we have three people named “Gina”. Now we want to remove the rows containing the name “Gina” and those born after 1990.

Delete Rows in Excel with Specific Text and Criteria

Steps:

We will first Filter the people born after 1990.

  • Click on the Filter icon of Born column.
  • From Number Filters, select Greater Than…

  • Put 1990 in “is greater than” box.
  • Press OK.

Delete Rows Using Filter Feature of Excel with Specific Text and Criteria

We will get the following result.

  • Now from the Name Filter icon select “Gina”.
  • Press OK.

Delete Rows with Specific Word and Condition

  • Select the rows and Right Click to open the Context Menu.
  • Then select Delete Row.
  • Click OK.

  • We will again remove the Filter to show all the data.

Finally, we will get the dataset without the textGina” born after “1990“.

Delete Rows with Specific Word and Condition 2

Read More: How to Filter and Delete Rows with VBA in Excel (2 Methods)


Similar Readings:


3. Delete Rows Containing Specific Word by Applying VBA

Our dataset contains sales rep, their region, and total sales volume. We want to remove the “EastRegion from this data set. VBA can be used to remove rows with matched text.

Steps:

  • Firstly, Press ALT + F11 or from Developer tab select Visual Basic to open the VBA window.
  • Secondly, Go to Insert then Module.

Delete Rows Containing Specific Word by Applying VBA

  • Thirdly, Write the following code in the Module.
Sub DeleteRowsWithSpecificText()
Dim x1 As Range
For Each x1 In Range("c5:c14")
    If x1.Value = "East" Then
        x1.EntireRow.Delete
    End If
Next x1
End Sub

  • Finally,  Run the code from Run Sub/UserForm.

Delete Rows Containing Specific Word by Applying VBA

Alternatively, you can press F5 to do that.
The rows containing the wordEast” are deleted from the dataset.

Delete Rows Containing Specific Text by Applying VBA

Related Content: Excel Shortcut to Delete Rows (With Bonus Techniques)


Practice Section

We have included extra datasets in the Excel Sheet. You may practice the 3 methods to delete rows and understand the methods more clearly.

Delete Rows Using 3 Methods with Specific Text Practice Sheet


Conclusion

We have used three methods to delete rows in Excel with specific text. We have used Excel Find, Filter, and VBA features to achieve our goal. You can download our worksheet to practice the methods. If you face any problems, you can ask questions in our comment section.


Related Articles

Rafiul Haq

Rafiul Haq

Hello! This is Rafiul. I have an engineering degree and an MBA (finance) degree. I am passionate about all things related to data, and MS Excel is my favorite application. I want to make people's lives easier by writing easy-to-follow and in-depth Excel and finance related guides here at ExcelDemy.

We will be happy to hear your thoughts

Leave a reply

5 Excel Hacks You Never Knew

Genius tips to help you unlock Excel's hidden features

FREE EMAIL BONUS

ExcelDemy
Logo