Skip to main content

How to delete all hidden rows or columns in Excel?

If you have a large workbook with a lot of hidden rows and columns, and now the hidden data are unavailable, you would like to delete all of them. How could you quickly delete them?

Delete all hidden rows and columns in a workbook with Inspect Document function

Delete all hidden rows and columns in active worksheet with VBA code

Delete all hidden rows or columns in a selection / worksheet / whole workbook with Kutools for Excel


arrow blue right bubble Delete all hidden rows and columns in a workbook with Inspect Document function

If you use Excel 2007, 2010 or Excel 2013, it is easily for you to remove the unwanted hidden rows or columns. You can do it as follow steps:

1. If you us Excel 2007, please click Office Button on the top left corner, and then click Prepare > Inspect Document. See screenshot:

doc-delete-hidden-rows1

If you use Excel 2010/2013, please click File > Info > Check for Issues > Inspect Document, see screenshots:

In Excel 2013:

doc-delete-hidden-rows2

In Excel 2010:

doc-delete-hidden-rows3

2. Then a Document Inspector dialog box will appear, click Inspect button, and the hidden rows and columns in the whole workbook have been inspected, click Remove All button, see screenshot:

doc-delete-hidden-rows4

3. And then click Close button to close the dialog. And all of the hidden rows and columns in the workbook will be removed.

Notes: 1. If there are formulas to manipulate the data in your workbook and the formulas call for data from hidden rows and columns, then deleting that information will cause incorrect result.

2. With this function, you can delete all of the hidden rows and columns in the whole workbook.


arrow blue right bubble Delete all hidden rows and columns in active worksheet with VBA code

If you just want to remove the hidden rows or columns in a worksheet, the following VBA code can help you. Please do as follows:

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and paste the following code in the Module Window.

VBA code: Delete all hidden rows and columns of active worksheet:

Sub deletehidden()
For lp = 256 To 1 Step -1
If Columns(lp).EntireColumn.Hidden = True Then Columns(lp).EntireColumn.Delete Else
Next
For lp = 65536 To 1 Step -1
If Rows(lp).EntireRow.Hidden = True Then Rows(lp).EntireRow.Delete Else
Next
End Sub

2. Then press F5 key to execute the code. And all the hidden rows and columns have been deleted in the active worksheet.

Note: If there are formulas to manipulate the data in your workbook and the formulas call for data from hidden rows and columns, then deleting that information will cause incorrect result.


arrow blue right bubble Delete all hidden rows or columns in a selection / worksheet / whole workbook with Kutools for Excel

With the Delete Hidden (Visible) Rows & Columns utility of Kutools for Excel, you can quickly remove the hidden rows or columns in selected range, in active worksheet, in selected worksheets and in all worksheets.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.

If you have installed Kutools for Excel, please do as this:

1. Click Kutools > Delete > Delete Hidden (Visible) Rows & Columns, see screenshot:

2. In the Delete Hidden (Visible) Rows & Columns dialog box, specify the scope that you want to apply the operation from Look in drop down list. (If you choose In Selected Range, you must select a range that you want to use first.) And then check Rows or Columns under Delete type. And select Hidden rows from Detailed type. Then click Ok, the hidden rows have been deleted from the selected range, see screenshot:

doc-delete-hidden-rows6

To know more about this feature, please visit the Delete Rows & Columns function.

Free Download Kutools for Excel Now!


arrow blue right bubble Demo: Delete all hidden rows or columns in a selection / worksheet / whole workbook with Kutools for Excel

Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days. Download and free trial Now!

Related Article:

How to delete hidden worksheets in Excel?

Best Office Productivity Tools

Supercharge Your Spreadsheets: Experience Efficiency Like Never Before with Kutools for Excel

Popular Features: Find/Highlight/Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns     Move Columns   |   Unhide Columns   |   Compare Columns to Select Same & Different Cells ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolset12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   Many More...

Kutools for Excel boasts over 300 features, ensuring that what you need is just a click away...

Supports Office/Excel 2007-2021 & newer, including 365   |   Available in 44 languages   |   Enjoy a full-featured 30-day free trial.

kte tab 201905


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (9)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
I come to your site a lot. My company would not allow me to buy your kutools product, although I would like to! I appreciate that you show all the different ways to do things. You've helped me out a lot, and you seem to really understand Excel. I'm sure your tool product is awesome.
This comment was minimized by the moderator on the site
Hello, friend,
May be Kutools can help you to solve your problem quickly and save a lot of time for you, you can download and try with no limitation in 60 days. And we will try our best to make the product more powerful.
Thank you for your comment.
This comment was minimized by the moderator on the site
THANK YOU for that VBA snippet! Saved the DAY, my friend!!! :lol:
This comment was minimized by the moderator on the site
instructions for excel macros
This comment was minimized by the moderator on the site
Thanks! It works like a charm!
This comment was minimized by the moderator on the site
VBA code perfect, thanks.
This comment was minimized by the moderator on the site
Thanks! This is helpful! But it seems removing the hidden columns and rows are taking too long. Is that normal if there's a lot of data in the excel? Like say... 3000+ hidden rows or something? :D
This comment was minimized by the moderator on the site
This was very helpful, thanks!
This comment was minimized by the moderator on the site
Just wanted to say this really helped me! Thank you so much! :)
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations