How to delete hidden rows in excel
Tutor 5 (273 Reviews)
Excel Tutor
Still stuck with a Excel question
Ask this expertAnswer
To delete hidden rows in Excel, you must first identify whether the rows are hidden manually or filtered. The method differs depending on the type of hidden rows.
1. Deleting Rows Hidden by Filters
Rows hidden by filters are temporarily invisible because a filter hides rows that do not meet specific criteria.
-
Select the entire range or the worksheet by pressing Ctrl + A.
-
Go to the Data tab on the ribbon.
-
Click Clear in the Sort & Filter group to remove filters.
-
Select the rows you want to delete. Hidden rows will become visible.
-
Right-click the selected rows and click Delete Row.
Hidden rows will be removed, and the visible data will shift up automatically.
2. Deleting Rows Hidden Manually
Manually hidden rows are rows hidden using Hide from the right-click menu or the Format → Hide & Unhide option.
-
Select the entire worksheet or the range containing hidden rows.
-
Press F5 to open the Go To dialog.
-
Click Special…
-
Select Visible cells only and click OK.
-
Right-click on the selected rows and choose Delete Row.
This ensures that only hidden rows are deleted without affecting visible data.
3. Using a Filter to Delete Hidden Rows
A faster method is to temporarily filter out visible rows and delete all remaining hidden rows:
-
Select your data range.
-
Go to the Data tab and click Filter.
-
Filter the data to show only visible rows (for example, by a column containing blanks).
-
Select the visible rows and delete them.
-
Remove the filter to reveal the remaining rows.
4. Using a VBA Macro for Hidden Rows
For large datasets, using a VBA macro can automate hidden row deletion.
-
Press Alt + F11 to open the VBA editor.
-
Click Insert → Module.
-
Paste the following code:
Sub DeleteHiddenRows()
Dim R As Range
For Each R In ActiveSheet.UsedRange.Rows
If R.Hidden Then R.Delete
Next R
End Sub
Press F5 to run the macro. All hidden rows in the active sheet will be deleted instantly.
5. Notes on Differences Between Windows and Mac
-
On Windows, pressing F5 → Special → Visible cells only works directly.
-
On Mac, press Cmd + Shift + Z to select visible cells only, since F5 does not open Go To by default.
Deleting hidden rows improves data clarity and ensures calculations and charts do not include unintended data.
. Was this Helpful?Get Online Tutoring or Questions answered by Experts.
You can post a question for a tutor or set up a tutoring session
Answers · 1
How to sort by highlighted cells in excel
Answers · 1
How to sort excel by column and keep rows together
Answers · 1
How to sort by time in excel
Answers · 1
How to sort alphabetically in excel by last name
Answers · 1