Hi Everyone,
The issue I am having is that the Worksheet_SelectionChange is not firing for me. I have a bunch of worksheets hidden in the file to decrease clutter, with a Navigation page visible - where clicking on the cell with the tile would unhide a corresponding sheet. For example cell B3 with text of "MLB" it would unhide the MLB worksheet and so on for the other pages.
In my workbook I have one module where I set Public variables for the current workbook and all of the worksheets in the workbook. Below is the code that I have in the specific navigation worksheet. All of the other sheets would be currently hidden. Can someone please advise how to get this code to run or point me in the right direction? I have made sure in the immediate window that screen updating and enabling events was set to true.
The issue I am having is that the Worksheet_SelectionChange is not firing for me. I have a bunch of worksheets hidden in the file to decrease clutter, with a Navigation page visible - where clicking on the cell with the tile would unhide a corresponding sheet. For example cell B3 with text of "MLB" it would unhide the MLB worksheet and so on for the other pages.
In my workbook I have one module where I set Public variables for the current workbook and all of the worksheets in the workbook. Below is the code that I have in the specific navigation worksheet. All of the other sheets would be currently hidden. Can someone please advise how to get this code to run or point me in the right direction? I have made sure in the immediate window that screen updating and enabling events was set to true.
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
Set Document = ActiveWorkbook
Set SummarySheet = Sheets("Navigation")
Set MLB = Sheets("MLB General")
Set NBA = Sheets("NBA General")
Set NFL = Sheets("NFL General")
'if statement for if cell is selected make the sheet visible
If Target.Address = SummarySheet.Range("B3") Then
MLB.Visible = True
MLB.Activate
MLB.Range("A1").Select
ElseIf Target.Address = SummarySheet.Range("B4") Then
NBA.Visible = True
NBA.Activate
NBA.Range("A1").Select
ElseIf Target.Address = SummarySheet.Range("B5") Then
NFL.Visible = True
NFL.Activate
NFL.Range("A1").Select
Else
'do nothing
End If
End Sub