How to Delete/Remove Hidden Worksheets in Excel?

If there are some hidden worksheets exist in excel and you want delete them as they are not useful, you can unhide all worksheets and remove them one by one. This way is quite annoying and complex. If we can remove all hidden worksheets by only one step or a simple way, it will be much better. So, this article will help you to solve this issue. I will provide you two ways to remove all hidden worksheets conveniently. Please read the article below, let’s get started.

Delete/Remove Hidden Worksheets by VBA

Edit VBA script can help you to remove all worksheets in one workbook properly. So, this method is very helpful. You can copy below code directly.

Step 1: On current visible worksheet, right click on sheet name tab to load Sheet management menu. Select View Code, Microsoft Visual Basic for Applications window pops up.

Or you can enter Microsoft Visual Basic for Applications window via Developer->Visual Basic.

Step 2: In Microsoft Visual Basic for Applications window, click Insert->Module, enter below code in Module1:

Sub RemoveAllHiddenSheets()

Dim i As Integer

  Application.DisplayAlerts = False

  For Each sht In ActiveWorkbook.Sheets

      If sht.Visible = xlSheetHidden Then


        i = i + 1

      End If

  Next sht

  Application.DisplayAlerts = True

End Sub

Step 3: Save the codes, see screenshot below. And then quit Microsoft Visual Basic for Applications.

Delete Hidden Worksheets1

Step 4: Before run macro, let’s see if there are unhide worksheets exist in this workbook.

Delete Hidden Worksheets2

Unhide is enabled in menu so there are some hidden worksheets in this workbook.

Step 5: On current sheet, click Developer->Macro, in Macro window, select Macro ‘RemoveAllHiddenSheets’, then click Run.

Delete Hidden Worksheets3

Step 6: Check if the hidden worksheets are removed or not.

Delete Hidden Worksheets4

Unhide is disabled so there is no hidden worksheet now.


  1. If you want to get some message when running macro to delete hidden worksheets, you can add below code into module. Then you can get some message prompts when executing the macro.
  If i = 1 Then

    MsgBox "[1] sheet is removed from this workbook."


    MsgBox "[" & i & "] sheets are removed from this workbook."

  End If
  1. See the screenshot below:

Delete Hidden Worksheets5

  1. Run macro this time, verify that below message pops up to indicate that some sheets are removed.

Delete Hidden Worksheets6

Delete/Remove Hidden Worksheets by Inspect Document Function

This method is helpful for the users who are not skilled in code editing. And they can follow below steps to remove all hidden worksheets. All operations are conveniently to operate.

Step 1: In Excel ribbon, click File->Info->Check for Issues->Inspect Document.

Delete Hidden Worksheets71

Step 2: Click Yes on pops up message.

Delete Hidden Worksheets8

Step 3: On pops up Document Inspector, click Inspect.

Delete Hidden Worksheets9

Step 4: On current Document Inspector window, drag the scrollbar to the end, verify that Hidden Worksheets is listed, click Remove All.

Delete Hidden Worksheets10

Step 5: Verify that all hidden worksheets were removed. Then click Close.

Delete Hidden Worksheets11

Step 6: Right click on sheet name tab to double check, verify that Unhide is disabled in menu, that means there is no hidden worksheet now.

Delete Hidden Worksheets12


Related Posts

Find and Replace Multiple Values

This post will guide you how to find and replace multiple values at once with VBA macro or using formula  in Excel. How do I make multiple find and replace in Excel. Suppose that you have a few cells containing ...

VBA Macro For VLOOKUP From Another Sheet

In the previous post, you should know that how to fix or remove the #N/A error when using VLOOKUP formula to lookup value from another sheet. And this post will show you how to use VBA code to vlookup data ...

How To Insert Comments in Protected Worksheet in Excel

This post will show you how to allow comments in a protected worksheet in Excel. You can easily to insert comments into cells in a normal worksheet in Excel, but if want to insert a comment in a worksheet that ...

How To Convert Text to Upper Cases(Using VBA) in Excel

This post will show you how to switch from lower case to upper case in Excel. and I am going to show you two different ways of converting text to upper cases using formula or VBA macro in Excel 2013,Excel ...

How To Hide Every Other Row in Excel (Using VBA)

This post will show you how to hide alternate rows or columns in Excel or how to hide every third, fourth, fifth row or column in Excel. If you want to hide every other row in your current worksheet, how ...