Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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


Delete multiple hidden / blank / visible columns or rows at once:

Kutools for Excel's Delete Hidden (Visible) Rows & Columns utility can help you to delete multiple blank, hidden, visible rows or columns at once.

doc-delete-hidden-rows6

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


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 60 days.

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

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

doc-delete-hidden-rows5

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 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Related Article:

How to delete hidden worksheets in Excel?


Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    RW · 5 months ago
    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.
    • To post as a guest, your comment is unpublished.
      skyyang · 5 months ago
      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.
  • To post as a guest, your comment is unpublished.
    DM · 4 years ago
    [u]THANK YOU[/u] for that VBA snippet! Saved the DAY, my friend!!! :lol:
  • To post as a guest, your comment is unpublished.
    Linda · 4 years ago
    instructions for excel macros
  • To post as a guest, your comment is unpublished.
    Bufon · 4 years ago
    Thanks! It works like a charm!
  • To post as a guest, your comment is unpublished.
    chris · 5 years ago
    VBA code perfect, thanks.