This post will guide you how to delete all hidden rows or columns in Excel 2010/2013/2016. How do I efficiently delete all hidden columns and rows in a worksheet in Excel. How to delete all hidden rows or columns with VBA macro in Excel. Show If you want to delete all hidden rows or columns in Excel, just do the following steps: #1 click File tab, and select Info menu from the popup menu list. #2 click Check for Issues button in the Info page. And select Inspect Document from the drop-down list. The Document Inspector dialog box will appear. #3 click Inspect button in the Document Inspector window. #4 click Remove All button in the Hidden Rows and Columns section. Delete All Hidden Row or Column with VBA MacroYou can also use an excel VBA macro to delete all hidden rows and columns in your worksheet. Just do the following steps: #1 open your excel workbook and then click on “Visual Basic” command under DEVELOPER Tab, or just press “ALT+F11” shortcut. #2 then the “Visual Basic Editor” window will appear. #3 click “Insert” ->”Module” to create a new module. #4 paste the below VBA code into the code window. Then clicking “Save” button. Sub deleteAllHidden() Dim ws As Worksheet For Each ws In ActiveWorkbook.Worksheets Dim lastRow lastRow = 4000 For iCntr = lastRow To 1 Step -1 If Rows(iCntr).Hidden = True Then Rows(iCntr).EntireRow.Delete Next Next ws End Sub#5 back to the current worksheet, then run the above excel macro. Click Run button. Avoid unintentionally distributing hidden information, such as the document's author, names that are associated with comments or tracked changes, or hidden cells or worksheets, by removing hidden data. To open the Document Inspector, click File > Info > Check for Issues > Inspect Document. The Excel Document Inspection window shown below opens up. After you have completed these steps, save the document, and the spreadsheet will not contain the hidden data that you have removed. Edit Document Properties, Personal Information and Other Document DataTo selectively edit or remove document data, click File > Info > Properties. Click Show All Properties. Delete or edit information. Selectively Remove or Edit CommentsMicrosoft Excel offers the ability to add comments to workbooks. Typically, comments contain the name of the person who created them, and they appear as a small red triangle in the upper-right corner of a cell. To view a comment, click the cell and the comment will pop up. To delete a comment, right-click the cell containing the comment, and then click Delete Comment on the shortcut menu. Selectively Display Hidden Cells, Rows, and ColumnsIn Microsoft Excel, it is possible to hide entire rows and columns of cells within a worksheet. To unhide all of the cells in a worksheet:
Selectively Display Hidden WorksheetsWorkbooks in Microsoft Excel may contain hidden sheets that contain information. To unhide sheets:
Remove Tracked Changes manually or selectively
Learn more about Tracking and Reviewing Changes at microsoft.com. Back to Removing Hidden Data Home
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 all hidden rows and columns in a workbook with Inspect Document functionIf 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: If you use Excel 2010/2013, please click File > Info > Check for Issues > Inspect Document, see screenshots:
In Excel 2013:
In Excel 2010: 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: 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. Delete all hidden rows and columns in active worksheet with VBA codeIf 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 Sub2. 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. Delete all hidden rows or columns in a selection / worksheet / whole workbook with Kutools for ExcelWith 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. 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: To know more about this feature, please visit the Delete Rows & Columns function. Free Download Kutools for Excel Now! Demo: Delete all hidden rows or columns in a selection / worksheet / whole workbook with Kutools for ExcelRelated Article: How to delete hidden worksheets in Excel? |