How to Delete Hidden Worksheets in Excel


Excel is a strong data−organization and analysis tool, and hidden worksheets are frequently encountered when working on complicated spreadsheets. These hidden worksheets can occasionally be confusing and have an impact on the general functionality of your Excel document.

This tutorial will walk you through the process of discovering and deleting hidden worksheets in Excel. This tutorial will equip you with the knowledge and techniques you need to clean up your workbook or simply delete superfluous sheets.

By the end of this course, you will understand how to detect and remove hidden worksheets in Excel, allowing you to manage and organise your workbooks more efficiently. So, let's get started and discover how to delete hidden worksheets in Excel!

Deleting Hidden Worksheets in Excel

Here, we will first create a VBA module and then run it to complete the task. So let us see a simple process to learn how you can delete hidden worksheets in Excel.

Step 1

Consider any Excel workbook where you have hidden workbooks.

First, right−click on any sheet name and select View code to open the VBA application.

Right click > View code.

Step 2

Then click on Insert, select Module, and copy the below code into the text box.

Insert > Module > Copy.

Example

Sub DeleteHiddenWorksheets()
    Dim ws As Worksheet
    Application.DisplayAlerts = False 
        For Each ws In ThisWorkbook.Worksheets
        If ws.Visible = xlSheetHidden Or ws.Visible = xlSheetVeryHidden Then
            ws.Delete
        End If
    Next ws
    
    Application.DisplayAlerts = True 
End Sub

Step 3

Then save the sheet as a macro−enabled template and click F5 to complete the task.

This is how you can delete hidden worksheets in Excel.

Conclusion

In this tutorial, we have used a simple example to demonstrate how you can delete hidden worksheets in Excel to highlight a particular set of data.

Updated on: 19-Jul-2023

225 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements