How to Delete Filtered Rows in Excel (Without Removing Hidden Data)

Deleting filtered rows in Excel sounds straightforward — but it trips up plenty of users because Excel's filter system separates visible rows from hidden rows in ways that aren't always obvious. Done correctly, you remove only what you can see. Done incorrectly, you risk wiping out data that was simply out of view.

Here's how the process actually works, what variables affect your results, and why the same steps can behave differently depending on your setup.

What Happens When You Filter in Excel

When you apply a filter in Excel, rows that don't match your filter criteria are hidden, not deleted. They still exist in the spreadsheet — they're just temporarily invisible. This is an important distinction.

If you select a visible range and press Delete, you clear the cell contents but leave the rows intact. If you want to physically remove the rows themselves (shifting remaining data upward), you need to delete the rows, not just the cell values.

This difference matters a lot:

  • Clearing contents removes data but keeps the row structure
  • Deleting rows removes the rows entirely and collapses the sheet

The Standard Method: Select Visible Cells, Then Delete Rows 🗑️

Here's the reliable process for deleting only the rows currently visible after filtering:

Step 1 — Apply your filter Use the filter dropdowns (Data → Filter) to display only the rows you want to remove.

Step 2 — Select the filtered (visible) rows Click the first visible row below the header, then extend your selection downward. You can use Ctrl + Shift + End to reach the last row, or manually drag.

Step 3 — Select visible cells only This is the critical step most users skip. Press F5 (or Ctrl + G) to open the Go To dialog, click Special, then choose Visible cells only. This tells Excel to ignore the hidden rows in your selection.

Alternatively, use Alt + ; (semicolon) on Windows as a direct shortcut to select visible cells only.

Step 4 — Delete the rows Right-click your selection → Delete Row. Excel removes only the visible rows. Hidden rows remain untouched.

Step 5 — Clear the filter Remove the filter to verify your hidden data is still intact.

Why Skipping "Visible Cells Only" Causes Problems

If you skip Step 3 and go straight to deleting, Excel may include hidden rows in the operation — depending on how you made your selection and which version of Excel you're using.

The "Visible cells only" selection acts as a mask. Without it, a contiguous drag-selection treats the range as a block, potentially catching hidden rows between visible ones.

This is especially relevant when:

  • Your filtered data has non-contiguous visible rows (rows 2, 5, 9 visible; rows 3, 4, 6, 7, 8 hidden)
  • You're working with large datasets where manual verification isn't practical
  • You're using Excel for Mac, where some keyboard shortcuts differ (use Cmd + Shift + Z or navigate via the Edit menu to find Go To Special)

Version and Platform Differences

EnvironmentGo To Special ShortcutVisible Cells Shortcut
Excel for WindowsF5 → SpecialAlt + ;
Excel for MacCmd + G → SpecialCmd + Shift + Z
Excel Online (browser)Limited — use ribbon menusNot always available
Google SheetsFilter views work differentlyNo direct equivalent

Excel Online has a reduced feature set compared to the desktop application. Some Go To Special options may not appear, which affects how reliably you can isolate visible cells before deleting. If you're working in a browser-based version and the method above doesn't behave as expected, that's likely why.

Using a Helper Column as an Alternative

For users working with complex filters or large datasets, a helper column approach adds a layer of control:

  1. Add a temporary column (e.g., column Z) and type a marker like 1 in every visible row you want to delete
  2. Clear the filter to reveal all rows
  3. Filter by your marker (1 in column Z)
  4. Delete those rows normally
  5. Remove the helper column

This method is slower but gives you a visual confirmation step before anything is permanently removed — useful when the stakes are high.

What About Macros and VBA? ⚙️

If you regularly need to delete filtered rows as part of a workflow, a short VBA macro can automate the process. The logic is:

Executing this in a loop requires care — deleting rows while iterating forward shifts row indices and causes rows to be skipped. The standard approach is to loop from bottom to top or collect the rows into a range object first and delete all at once.

Whether a macro approach makes sense depends on how often you perform this task, your comfort level with VBA, and whether your organization's Excel policies allow macros to run.

The Variable That Changes Everything

The steps above work consistently in a fully licensed desktop version of Excel (Microsoft 365 or Excel 2016 and later) on Windows. But outcomes shift based on:

  • Excel version — older versions may lack certain Go To Special behaviors
  • Platform — Mac and browser versions have different shortcut sets and feature availability
  • Dataset structure — merged cells, tables (formatted as Excel Tables vs. plain ranges), and protected sheets all interact with row deletion differently
  • File format — .xlsb and .xlsx files generally behave the same, but shared/collaborative workbooks may restrict structural changes

Excel Tables (created via Insert → Table) handle filtered row deletion slightly differently than plain ranges — deleting a row in a Table removes it from the Table object cleanly, which can actually make the process more predictable.

Whether the standard method, the helper column approach, or a macro fits your situation depends on how your data is structured, how often you do this, and which version of Excel you're actually running. 📊