Open In App

How to Delete Filtered Rows in Excel: Step by Step Guide

Last Updated: 09 Jan, 2025

M

Summarize
Comments
Improve
Suggest changes
Like Article
Like
Share
Report
News Follow

Efficiently managing data in Excel often involves filtering and removing unnecessary rows. However, deleting filtered rows in Excel can be tricky if not done correctly, as unwanted data may get removed. This article provides a step-by-step guide to help you safely and accurately delete filtered rows without affecting unfiltered data. Whether you’re cleaning up a large dataset or organizing information for analysis, this guide is tailored to save you time and prevent errors while working in Excel.

Disclaimer: Double-check your data and backup your worksheet before applying bulk actions to avoid accidental loss of important information.

How to Delete Filtered Rows in Excel

Delete Filtered Rows in Excel

What Are Filters in Excel

Filters in Excel help narrow down data so that you can view only the information you need, without permanently deleting the rows. Filters hide rows that don’t match your criteria. However, once your data is filtered, you may need to delete certain rows that are no longer required. This is particularly helpful in cleaning up large datasets or when preparing your data for analysis.

Why Delete Filtered Rows

Deleting filtered rows can help clean up your data and make it more relevant by removing unnecessary or irrelevant entries. For instance, if you’re analyzing sales data, you might want to filter out and delete rows where sales are below a certain threshold. However, deleting filtered rows incorrectly can accidentally remove unfiltered data, so it’s crucial to follow the right steps.

How to Filter and Delete Rows in Excel

Let’s consider you have the dataset with the names of some employees with their ages and their designations and you want to delete all rows in which the Designation is Operations.

How to Delete Filtered Rows in Excel

Step 1: Select the Data Range

Select the Data range where you want to apply the Filters.

Step 2: Go to the Home Tab and Select Format as Table

Navigate to the Home tab, and then choose the Format as a Table option, selecting the type that suits your preference.

How to Delete Filtered Rows in Excel

Step 3: Select the range and Click Ok

Select the range and click ok.

How to Delete Filtered Rows in Excel

Step 4: Apply Filter to the Column

Click the arrow located in the column header where you wish to activate the filter. At this point, all the data in that column will be highlighted.

Step 5: Deselect Select All and check the box next to Operations

How to Delete Filtered Rows in Excel

Step 6: Preview Result

Check the results after following and performing the steps given here.

How to Delete Filtered Rows in Excel

Step 7: Delete the Visible Rows

To remove rows, either right-click and choose “Delete Row” from the context menu, or use the keyboard shortcut Ctrl and the minus (-) key.

How to Delete Filtered Rows in Excel

Step 8: Clear the Filter

  • Go back to the Data tab.
  • Click on Clear to remove the filter and display all rows.

How to Delete Filtered Rows in Excel

Step 9: Preview the Result

Check the results after following and performing the steps given here.

How to Delete Filtered Rows in Excel

How to Delete Hidden Rows in Excel After Filtering

Hidden rows that are unrelated to your filters can still remain in your dataset, creating inconsistencies or clutter. Here’s a clear guide on how to delete hidden rows in Excel after applying filters:

Step 1: Open File and Select Info

  • Click the File tab in the ribbon.
  • From the menu, select Info.
How to Delete Filtered Rows in Excel

Navigate to the File Tab

Step 2: Open Document Inspector

  • Click on Check for Issues, located under the Info menu.
  • Select Inspect Document from the dropdown.
How to Delete Filtered Rows in Excel

Select Inspect Document

Step 3: Enable Hidden Rows and Columns Option

  • In the Document Inspector window, scroll through the options.
  • Ensure the checkbox for Hidden Rows and Columns is selected.
How to Delete Filtered Rows in Excel

Put a Tick Mark on Hidden Rows and Columns Choice

Step 4: Inspect the Document

  • Click the Inspect button at the bottom of the Document Inspector window.
  • Wait for Excel to scan the document for hidden rows and columns.
How to Delete Filtered Rows in Excel

Click the Inspect Button on the Base

Step 5: Remove Hidden Rows

  • If hidden rows or columns are detected, the Remove All button will appear.
  • Click Remove All to delete all hidden rows and columns from your worksheet.

How to Delete Filtered Rows in Excel

Step 6: Close the Document Inspector

  • Once all hidden rows are removed, click the Close button to exit the Document Inspector window.
  • Return to your worksheet and verify that only visible rows related to your filters remain.

How to Delete Filtered Rows in Excel

How to Delete Filtered Rows Using Go To Special

To delete only the visible rows after applying a filter, follow these steps using Excel’s Go To Special feature:

Step 1: Select Visible Cells

  • Highlight the visible rows you want to delete in the filtered dataset.
  • Press F5 to open the Go To dialog box.
  • Click the Special button in the dialog box.

How to Delete Filtered Rows in Excel

Step 2: Choose Visible Cells Only

  • In the Go To Special dialog box, select the Visible cells only option.
  • Click OK to confirm.

How to Delete Filtered Rows in Excel

Step 3: Delete Rows

  • Verify that only the visible cells are selected.
  • Right-click within the selected range to open the context menu.
  • Choose Delete Rows from the menu.

How to Delete Filtered Rows in Excel

Step 4: Review the Results

  • Verify that the visible rows have been deleted.
  • Clear or expand the filter to confirm that only the hidden rows remain in the dataset.

How to Delete Filtered Rows in Excel

How to Delete Filtered Rows in Excel Using VBA

Follow these steps to efficiently delete filtered rows in Excel using VBA:

Step 1: Open the VBA Window

  • Right-click on the sheet tab at the bottom of your workbook and select View Code.
  • Alternatively, press Alt + F11 to open the Visual Basic for Applications (VBA) editor.

Step 2: Insert a Module

  • In the VBA editor, click Insert > Module to create a new module.
  • Copy and paste the following VBA code into the module:

Sub RemoveHiddenRows()

Dim rng As Range

Set rng = ActiveSheet.UsedRange

On Error Resume Next

rng.SpecialCells(xlCellTypeVisible).EntireRow.Delete

On Error GoTo 0

End Sub

Step 3: Run the Macro

  • Close the VBA editor and return to Excel.
  • Click Developer > Macros, select RemoveHiddenRows, and click Run.
    (If you don’t see the Developer tab, enable it from Excel Options.)

To know how to run a macro click here

Step 4: Confirm Removal

  • Once the macro runs, it will delete all visible rows in the filtered dataset.
  • Check your worksheet to confirm that only the desired rows remain.

VBA – How to Delete AutoFiltered Rows Except for the Header

Follow these steps to delete rows in Excel with AutoFilter applied, while keeping the header intact:

Step 1: Apply AutoFilter

  • Select the data range, including the header row.
  • Navigate to the Data tab and click Filter to apply AutoFilter to your dataset.

Step 2: Filter Your Data

  • Click the dropdown arrow in the column header where you want to filter.
  • Select the criteria to filter the rows you want to delete.

Step 3: Select the Filtered Rows

  • Once the filter is applied, highlight the visible rows (excluding the header).
  • Click the row number of the first visible row.
  • Hold the Shift key and click the row number of the last visible row.

Step 4: Delete the Selected Rows

  • Right-click the selected row numbers and choose Delete Row from the context menu.
  • Alternatively, press Ctrl + – (minus key) to delete the rows quickly.

Step 5: Remove the Filter

  • Return to the Data tab and click Filter again to remove the AutoFilter.
  • Verify that only the header row and unfiltered data remain.

How to Delete Filtered Rows in Excel Using Power Query – Advanced Method

Follow these steps to remove filtered rows effectively using Power Query:

Step 1: Load Data into Power Query

  • Open your Excel workbook and select the data range or table you want to work with.
  • Navigate to the Data tab and click From Table/Range.
  • This action will open the Power Query Editor.

Step 2: Apply Filters

  • In the Power Query Editor, locate the column header you want to filter.
  • Click the dropdown arrow and select the criteria to filter the rows you wish to keep.

Step 3: Remove Filtered Rows

Once your data is filtered, go to the Home tab in the Power Query Editor.

Click Remove Rows in the toolbar.

  • Select Remove Blank Rows to eliminate any empty rows.
  • Choose Remove Other Rows to delete the filtered-out rows.

Step 4: Close & Load

After completing the changes, click Close & Load to return the modified data to your Excel worksheet.

The cleaned data will now appear in your workbook without the filtered rows.

Additional Tips

  • Keep Original Data: Power Query works on a copy of your data. The original data remains intact, and changes are applied only to the data loaded back into Excel.
  • Query Editing: You can always go back to the Power Query Editor to make further adjustments to your filters and data as needed.

This process allows you to efficiently delete filtered rows in Excel using Power Query while keeping your data organized and manageable.

Conclusion

Learning how to delete filtered rows in Excel is essential for maintaining a clean and efficient dataset. Whether you use basic filtering, advanced VBA techniques, or Power Query, each method provides a unique way to streamline your data. These steps ensure accuracy and prevent accidental deletion of important information. By mastering these techniques, you’ll enhance your productivity and Excel expertise, making data management more effective.

How to Delete Filtered Rows in Excel – FAQs

Why there is a need to delete rows not shown in a Filter?

Deleting rows not shown in a Filter can help you streamline and optimize your data by removing unnecessary or hidden information. This can improve data analysis, reduce file size, and enhance the clarity of your worksheet.

What are the benefits of using the Document Inspector Method?

The Document Inspector method ensures a thorough examination of your Excel file for hidden rows and columns. It offers a systematic way to identify and remove hidden content, enhancing data privacy and file integrity.

How to recover deleted rows using these methods?

You cannot recover the deleted rows using the above methods. You can only make a backup of your original data to avoid any accidental data loss.

How to delete only specific columns using these methods?

The methods described in the article focus on deleting rows based on the visibility in the filter. If you need to delete specific columns while retaining rows, you may need to modify the provided VBA code or explore alternative approaches.

What is the shortcut key for deleting filtered rows in Excel?

There is no direct shortcut key for deleting filtered rows in Excel, but you can use the following steps for efficiency:

Select the filtered rows.

  • Use the keyboard shortcut Ctrl + – (minus key) to delete the rows.
  • This method ensures only visible (filtered) rows are deleted.

How to select only filtered rows in Excel?

To select only the filtered rows in Excel:

  • Apply a filter to your dataset.
  • Press F5 to open the Go To dialog box.
  • Click Special, select Visible cells only, and click OK.

Now only the visible (filtered) rows will be selected, allowing you to perform actions like deleting or copying them.



M

News
Improve
Discuss
Do you want to advertise with us?Click here to know more

How to Insert Multiple Rows in Google Sheets: Step-by-Step Guide with Shortcuts

article_img
Are you looking to insert multiple rows in Google Sheets quickly and efficiently? Whether you’re managing large datasets, updating project plans, or organizing financial information, knowing how to add multiple rows at once can significantly enhance your productivity. In this article, you will learn the different methods to insert multiple rows in Google Sheets, including shortcuts, right-click options, and more.Table of ContentHow to Insert Multiple Rows at the Bottom of Google Sheet How to Insert Row a Single Row in Google Sheets Using Insert Tab How to Insert Multiple Rows in Google Sheets by Right-Clicking How to Insert Rows in Google Sheets on AndroidHow to Add a Row Using Insert Row Icon in Google Sheet How to Insert Multiple Rows In Google Sheets Using Insert TabHow to Insert Rows in Google Sheets ShortcutStep-by-Step Guide to Inserting Multiple Rows in Google SheetsWhen working with large datasets, the ability to insert multiple rows quickly can be a game-changer. Here’s how you can do it:How to Insert Rows at the Bottom of Google Sheets Here we will know how to insert multiple rows in Google Sheets with easy and simple steps.Step 1: Open Google Sheets and Select the Shee
Read More

How to Group Rows in Google Sheets (Step-By-Step Guide)

article_img
Grouping rows in Google Sheets allows you to organize and manage large datasets more effectively by collapsing or expanding sections of your data. This feature is useful for summarizing information, reducing clutter, or focusing on specific sections of your spreadsheet without deleting any data. Whether you're handling financial records, project tasks, or long lists, grouping rows helps streamline your workflow and makes it easier to navigate complex spreadsheets.How to Group Rows in Google SheetsHere are the simple steps to group rows in Google Sheets:Step 1: Select the RowsHighlight the rows you want to group by clicking and dragging over their row numbers on the left.Select the RowsStep 2: Open the MenuRight-click anywhere on the highlighted rows to open the context menu.Open the MenuStep 3: Choose "Group Rows"From the menu, select "Group rows." You will see an outline bracket appear to the left of the selected rows.Choose "Group Rows"Step 4: Collapse or Expand the GroupClick the minus (-) sign to collapse the group or the plus (+) sign to expand it as needed.Collapse or Expand the GroupAlso Read: Google Sheets AVERAGEIF Function Google Sheets AVERAGEIFS Function Google Sheets S
Read More

How to Delete a Twitter Account (Now X): A Step-by-Step Guide for 2024

article_img
Twitter, now rebranded as X, has undergone significant changes since Elon Musk's takeover, leading many users to consider deleting their accounts. Whether it's the new features, changes in verification, or the loss of the iconic blue bird logo, many users are finding it challenging to navigate the platform. If you're among those looking to delete your X account permanently, this guide will walk you through the process on both desktop and mobile devices. Learn how to deactivate and delete your Twitter account (X) effectively and securely.Table of ContentDeactivating Vs Deleting your X Account Deactivating your X (Twitter) Account Deleting your X (Twitter) AccountWhy You Might Want to Delete Your Twitter (X) AccountHow to Delete Your Twitter Account on Your DesktopHow to Delete Twitter Account on Mobile Deactivating Vs Deleting your X Account Deactivating your X (formerly Twitter) account is temporary—you can reactivate it within 30 days, and your data stays intact. Deleting your account is permanent—after a 30-day deactivation period, all your data and activity are erased, and you can't recover your account. Choose deactivation for a break or deletion to leave the platform for good.
Read More

How to Delete Discord Servers: Step by Step Guide

article_img
Discord is a popular platform that brings people together through voice, video, and text, making it a go-to space for gamers, communities, and friends alike. But as your needs change, you might need to know how to delete a Discord server. Whether you are on Mobile, PC, iPhone, or Android this article fulfills all your requirements. In this article, we'll walk you through the steps to delete a Discord server, ensuring your community management is smooth and hassle-free. From handling permissions to understanding the implications of deletion, we’ve got all the tips you need.If you're wondering, how to delete a Discord server or searching for "Discord how to delete server," you're in the right place. Deleting your server is a permanent action, so it’s crucial to be certain before proceeding. This process is straightforward but requires careful steps to ensure you don't accidentally lose valuable data. Whether it's a public community or a private server with friends, learning how to delete your Discord server can help keep your digital spaces organized and relevant to your current needs. Let's get into the details and make the deletion process as easy as possible!How to delete discord
Read More

How to Create a Graph in Excel: A Step-by-Step Guide for Beginners

article_img
Anyone who wants to quickly make observations and represent them graphically should know how to create graphs with Excel. Whether it is the preparation of business analysis papers, academic research documents or financial reports among other things, learning how to make graphs in Excel can significantly improve the way you present information derived from different sources. By exploring Excel’s vast array of options, you have what it takes to convert raw information into coherent visuals that immediately reveal any trends, consistencies, and anomalies, also we will encounter to create charts in Excel from data.In this article, we will learn to make graphs in Excel or create a graph in Excel along with the several categories of graphs such as creating pie graphs in Excel, bar graphs in Excel and so on.Table of ContentWhat is a Chart or Graph in ExcelHow to Create Charts in ExcelType of Charts in MS ExcelHow to Create Surface Graph in MS ExcelHow to Create Histogram in ExcelHow to Format the ChartHow to Change Chart TypeWhat Are Charts and Graphs in ExcelCharts and graphs in Excel are powerful tools for data visualization. They help you present and analyze data graphically, making it
Read More

How to Use the UNIQUE Function in Excel: Step by Step Guide

article_img
Do you struggle with manually removing duplicates in Excel? The UNIQUE function is here to make your life easier! In this article, you’ll learn how to quickly extract unique values from a list or range using the Excel UNIQUE function. Let’s get into the step-by-step process, formula examples, and everything you need to know. How to Use the UNIQUE Function in ExcelTable of ContentWhat is the Unique Function in ExcelKey Features of the UNIQUE FunctionHow to Use the UNIQUE Function to Remove DuplicatesHow Does the UNIQUE Function Work?Advanced Usage of the UNIQUE FunctionWhat is the Unique Function in ExcelThe UNIQUE function in Excel is a powerful tool that allows you to automatically filter out duplicate values from your data. Whether you’re dealing with a long list of names, numbers, or other data, the UNIQUE function extracts only the distinct entries, saving you time and effort. This function is part of Excel's dynamic array features and is particularly useful when working with large datasets, making data analysis and reporting a breeze.Key Features of the UNIQUE FunctionThe UNIQUE function in Excel is a part of the dynamic array features and has a few vital information to main
Read More

How to use Copilot in Excel with Examples (Step-by-Step Guide)

article_img
As of 2024, Microsoft introduced a new feature called Copilot for Excel, part of the broader Microsoft 365 suite, designed to enhance productivity and streamline data manipulation using AI-powered tools. The introduction of Excel Copilot is transforming how professionals across industries manage and interpret their data. This AI-driven tool enhances productivity, automates repetitive tasks, and simplifies complex data analysis. In this detailed guide, we'll explore how to effectively use Copilot in Excel, complete with practical examples to illustrate its capabilities.How to use Copilot in Excel with ExamplesTable of ContentWhat is Copilot in Excel?How to Access Copilot in ExcelExcel Copilot Advantages in ExcelHow to Use Copilot in Excel (November 2024)Different Ways to use Copilot in Excel (Including Copilot Prompt)What is Copilot in Excel?Microsoft Excel Copilot is an innovative, AI-powered feature designed to enhance productivity and streamline data processing tasks within Excel. As a part of the Microsoft 365 suite, Excel Copilot transforms how users interact with data by offering advanced artificial intelligence capabilities that simplify complex operations, automate repetitiv
Read More

How to Insert a Checkbox in Excel: Step-by-Step Guide

article_img
How to Add Checkboxes in Excel: Quick Steps Enable the Developer Tab >>Go to Developer TabControl Group >> Click InsertSelect Checkboxes >>Place the CheckboxesLink the Checkbox to a CellAdding interactive elements like checkboxes to your spreadsheets can significantly improve functionality and organization. Whether you're managing task lists, tracking attendance, or creating interactive reports, learning how to insert a checkbox in Excel is a valuable skill. This guide provides a detailed explanation of how to add checkboxes in Excel, covering everything from enabling developer tools to formatting and customizing the checkboxes to suit your needs.Disclaimer: Ensure your data is well-structured to maximize the benefits of using checkboxes in your spreadsheet.Insert a Checkbox in ExcelTable of ContentWhat is a Checkbox in ExcelHow to Add a Checkbox in Excel : Step-by-Step GuideHow to Get the Developer Tab in the Excel RibbonHow to Insert a Checkbox in Excel How to Customize the Checkbox in ExcelHow to Insert Checkboxes in Excel without Developer Tab How to Link a Checkbox to a Cell How to Insert Multiple Checkboxes in Excel How to Create To-Do List Using Excel Check
Read More

How to Unhide and Show Hidden Columns in Excel: Step by Step Guide

article_img
How to Unhide all Columns in Excel- Quick StepsOpen MS Excel >> Select the Entire WorksheetRight-click on Column Headers >> Select "Unhide"Columns VisibleUnhiding columns in Excel is a simple but essential task when working with hidden data. Whether to make a worksheet look cleaner or accidentally disappeared, knowing how to unhide them ensures all your information is accessible and organized. This guide will walk you through step-by-step methods to unhide columns in Excel, helping you efficiently manage and analyze your data.Table of ContentWhy Do Columns Get Hidden in ExcelHow to Unhide All Columns In Excel (Windows and Mac)How to Unhide All Columns in Excel Using the Format ToolHow to Unhide All Columns by Setting the Column WidthHow to Unhide Columns in Excel Using Keyboard ShortcutHow to Unhide all Columns Automatically with VBA MacroHow to Show All Hidden Columns in ExcelHow to Check the Number of Hidden Columns in a WorkbookAlternative Method to check the Hidden Column in Excel Why Do Columns Get Hidden in ExcelColumns may be hidden intentionally to:Simplify data presentation.Protect confidential information.Organize large datasets.Columns may also appear hidden
Read More

How to Protect a Sheet in Excel: Step by Step Guide

article_img
How to Protect a Sheet in Excel- Quick Steps Right Click on the Worksheet Tab Select Protect Sheet >>Enter Password Select the Actions you want to allow the UsersClick OkWhen working with sensitive or shared data in Excel, ensuring the security of specific sheets is essential. Excel sheet protection allows you to safeguard the contents of your worksheet, restricting edits while still enabling other users to view the data. Whether you want to secure a worksheet in Excel or protect an entire workbook, Excel offers multiple methods to maintain data integrity and prevent unauthorized changes.In this guide, we will cover step-by-step instructions for protecting Excel sheets using the context menu and Review tab, securing entire workbooks, and even protecting your Excel files. These techniques will help you keep your data secure while maintaining collaborative efficiency.Disclaimer: Always ensure that you keep your passwords secure and regularly back up your work to avoid data loss or any potential security threats.How to Protect Sheet in ExcelTable of ContentHow to Protect a Sheet in ExcelHow to Protect a Excel Workbook How to Protect the Files in Excel How to Protect a Sheet in E
Read More
three90RightbarBannerImg