How to delete hidden worksheets in Excel?

Perhaps you have a workbook contains many hidden worksheets which aren’t useful, and they take up so many bits, now you want to delete all of the trashy hidden worksheets. How could you quickly delete them?

Delete hidden worksheets with VBA code

Delete hidden worksheets with Kutools for Excel


Hot
Amazing! Using Tabs in Excel like Firefox, Chrome, Internet Explore 10!

Learn more Free download

arrow blue right bubbleDelete hidden worksheets with VBA code

The following VBA code will delete all hidden worksheets within a workbook.

1. Open the workbook you want to delete the hidden worksheet.

2. Click Developer > Visual Basic, a new Microsoft Visual Basic for applications window will be displayed, click Insert > Module, then copy and paste the following code into the Module:

Sub deletehidden()
Dim a As Integer
a = 1
While a <= worksheets="" count="" span="">
If Not Worksheets(a).Visible Then
Worksheets(a).Delete
Else
a = a + 1
End If
Wend
End Sub

3. Click  doc-multiply-calculation-3 button to execute the code, and a warning window will pop out for each hidden worksheet to make sure that you really want to delete it. See screenshot:

doc-delete-hidden-worksheets1

4. Then click Delete. And all of the hidden worksheets have been deleted.


arrow blue right bubbleDelete hidden worksheets with Kutools for Excel

If you want to delete the hidden worksheets quickly, you can use Kutools for Excel.

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

After installing Kutools for Excel, you can do as follows:

Go to the ribbon, and click Kutools > Worksheet Tools > Delete All Hidden Sheets, then a prompt box pops out to remind you if you really want to delete all hidden worksheets. See screenshot:

doc-delete-hidden-worksheets2

Click Yes, and another prompt box will appear to remind you how many hidden worksheets have been deleted. See screenshot:

doc-delete-hidden-worksheets3

Click OK to finish this task.


Kutools for Excel

More than 120 Advanced Functions for Excel 2013, 2010, 2007 and Office 365.

screen shot

btn read more     btn download     btn purchase