Table of Contents
In this article we will learn how to unhide all sheets in excel using as simple VBA code
Steps to insert code
- Open the Visual Basic Editor using Alt + F11
- Goto Insert Tab
- Click on Module
- Paste the below code into module
Code
Sub UnhideAllSheets()
Dim wsSheet As Worksheet
For Each wsSheet In ActiveWorkbook.Worksheets
wsSheet.Visible = xlSheetVisible
Next wsSheet
End Sub
Import Code into your file
You can directly import the above code into your Excel file by following the below steps:
- Download the code file from here
- Open the Visual Basic Editor using Alt + F11
- Goto File Menu
- Click on Import File
- Browse to the folder path where the downloaded file is saved
- Click on Open
- The code is now available in your file.
Run Macro in Download File
- Go to Developer Tab –> Macros
- Click on UnhideAllSheets
- Click on Run
This is how we can unhide all hidden and very hidden sheets in excel using VBA / macros code.
Download File
Any Excel workbook in which macros are written should be saved in .xlsm (Excel Macro-Enabled workbook)format.