• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

hide all worksheets having hyperlink except the "MASTER"

Sir
I need your help once again as I am trying to hide all worksheets having hyperlink except the "MASTER" when my file is opened and unhide each worksheet when a text box with a hyperlink is selected. The sheet should be hidden again once the "return to menu" text box is selected. The main dashboard can stay active all the time

Regards

Abid Hussain
 

Attachments

  • PRC(2022-2032).xlsm
    776.3 KB · Views: 6
Delete all hyperlinks.
Can be done with this code in the active sheet
Code:
Sub del()
ActiveSheet.Hyperlinks.Delete
End Sub
Next put this code in the ThisWorkbook module
Code:
Private Sub Workbook_Open()
Application.ScreenUpdating = False
For Each wsSheet In Worksheets
    wsSheet.Visible = False
        If wsSheet.Name = "MAIN" Or wsSheet.Name = "Employee master" Then
            wsSheet.Visible = True
        End If
Next wsSheet
Application.Goto Sheets("MAIN").[A1]
End Sub
Sheets MAIN and Employee master wil stay visible.
For all of your home buttons use this code
Code:
Sub home()
ActiveSheet.Visible = False
    Application.Goto Sheets("MAIN").[A1]
End Sub
Under your buttons use this code, this is the code for the index sheet
Code:
Sub index()
Sheets("INDEX").Visible = xlSheetVisible
    Application.Goto Sheets("INDEX").[A1]
End Sub
note: there is a leading space in Minimum Wages sheet name
 
Delete all hyperlinks.
Can be done with this code in the active sheet
Code:
Sub del()
ActiveSheet.Hyperlinks.Delete
End Sub
Next put this code in the ThisWorkbook module
Code:
Private Sub Workbook_Open()
Application.ScreenUpdating = False
For Each wsSheet In Worksheets
    wsSheet.Visible = False
        If wsSheet.Name = "MAIN" Or wsSheet.Name = "Employee master" Then
            wsSheet.Visible = True
        End If
Next wsSheet
Application.Goto Sheets("MAIN").[A1]
End Sub
Sheets MAIN and Employee master wil stay visible.
For all of your home buttons use this code
Code:
Sub home()
ActiveSheet.Visible = False
    Application.Goto Sheets("MAIN").[A1]
End Sub
Under your buttons use this code, this is the code for the index sheet
Code:
Sub index()
Sheets("INDEX").Visible = xlSheetVisible
    Application.Goto Sheets("INDEX").[A1]
End Sub
note: there is a leading space in Minimum Wages sheet name
Thank you so much Sir.
 
Back
Top