19 | 08 | 2017

Hide or Show all Sheets

 

Sub HideSheets()

'****************************************
'*** Code from VisibleVisual.com ********
'****************************************

'This code hides all sheets except one.
'One sheet always needs to be visible.
'Add the sheetname that should be always visible.
'In this example the sheetname is SHEET1

Dim osht As Worksheet

For Each osht In ThisWorkbook.Worksheets

If osht.name = "Sheet1" Then GoTo nextSheet
osht.Visible = False

nextSheet:

Next osht

End Sub

Sub ShowAllSheets()
'****************************************
'*** Code from VisibleVisual.com ********
'****************************************

'This code makes all hidden sheets visible.

Dim osht As Worksheet

For Each osht In ThisWorkbook.Worksheets
If osht.Index = 0 Then GoTo nextSheet

osht.Visible = True

nextSheet:
Next osht

End Sub
Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2329001
Latest Articles