Forum Discussion
TARUNKANTI1964
May 12, 2022Brass Contributor
Excel-Vba
Hi, I have an Excel Workbook Having 5(Five) No’s of Excel Sheet in named 1) DASH BOARD,2) Sheet1,3) Sheet2,4) Sheet3,5) Sheet4. In DASH BOARD Sheet there is 4(Four) No’s Button exist in named GoToShe...
- May 12, 2022
See the attached sample workbook. Code in Module1 and in ThisWorkbook.
Jim_Stiene
Jan 14, 2024Copper Contributor
That's pretty common.
Sub HideSheets() 'hide sheets not named DASHBOARD
Dim i As Integer, Sh1 As String
For i = 1 To ThisWorkbook.Sheets.Count
Sh1 = Sheets(i).Name
On Error Resume Next
If Sh1 <> "DASHBOARD" Then
Sheets(Sh1).Visible = xlSheetHidden
End If
Next i
End Sub
Sub UnHideSheets() 'unhide sheets
Dim i As Integer
For i = 1 To ThisWorkbook.Sheets.Count
On Error Resume Next
Sheets(i).Visible = xlSheetVisible
Next i
End Sub