VBA to Unhide All Hidden Sheets

Excel currently has no unhide All feature for worksheets and as an Excel user it can be tedious right clicking on a sheet and clicking Unhide for each hidden sheet in the workbook.  The alternative is to produce some code which will unhide all of the sheets in the workbook and put it in your Personal Macro Workbook.   The following simple lines of code will unhide all of the hidden sheets in a workbook.

Sub UnhideMe() 'Unhide all of the sheets which are hidden in an Excel file.
Dim ws As Worksheet
'In Case all sheets are visible.
On Error Resume Next
For Each ws In Sheets
ws.Visible=True
Next
On Error Goto 0
End Sub

If you only want to unhide certain sheets then the following should do exactly that.

Sub UnhideMe2() 'Unhide specific sheets which are hidden in an Excel file.
Dim ar As Variant
Dim ws As Variant

'In Case either or both sheets are visible.
ar=Array("Sheet1", "Sheet2")

For Each ws In ar
Worksheets(ws).Visible=xlSheetHidden
Next ws

End Sub

The above will hide sheet1 and Sheet2.

Hide All but the Far Right Sheet

The following code snippet assumes the sheet you want visible is the right most sheet in your workbook.

Sub hide() 'Hide all of the sheets which are hidden in an Excel file.
Dim i As Integer
For i=1 To Worksheets.Count - 1
Sheets(i).Visible=False
Next i
End Sub