VBA Excel | Unhide All Sheets

In this tutorial, we will run a rather simple VBA code to unhide all worksheets in an Excel workbook.
Sometimes we find files with a large number of hidden worksheets and unhiding them all can only be done one by one.

Excel VBA File 

Manual

GitHub Project



Instructions

Follow these steps:



Step 1: Open Visual Basic by pressing alt + F8 (option+F8 Mac) or going to Developer > Visual Basic. 

Step 2: Add a new module if there is not one already.

Step 3: Enter or copy and paste the following code in the new module:

	Sub UnhideAllSheets()

		Dim ws As Worksheet

		For Each ws In ActiveWorkbook.Worksheets
			ws.Visible = xlSheetVisible
		Next ws

	End Sub
	
	

Step 4: Close Visual Basic.

Step 5: Select the workbook to be processed.

Step 6: Press F5 (optio+F5 MAc )to open the ‘run macro’ or go to Developer > Macros.

Step 7: Select the macro UnhideAllSheets and click Run.

Step 8: To save the macro file, save it as .xlsm or better, .xlsb.

Contact Antonio on Linkedin.