Morning,
I have 3 cells on a sheet (C18,D18, E18), that contain variable values, depending on selections made elsewhere on the sheet. The value that is shown on each of the 3 cells, are the names of hidden sheets. I want to be able to unhide the sheet(s) by selecting the relevant cell (C18, D18 or E18).
I have been using the following VBA, but for some reason it's no longer working. I'm using Excel version 16.71.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("C18, D18, E18")) Is Nothing Then Worksheets(Target.Value).Visible = xlSheetVisible
Application.EnableEvents = True
End sub
Any help to resolve this would be appreciated.
I have 3 cells on a sheet (C18,D18, E18), that contain variable values, depending on selections made elsewhere on the sheet. The value that is shown on each of the 3 cells, are the names of hidden sheets. I want to be able to unhide the sheet(s) by selecting the relevant cell (C18, D18 or E18).
I have been using the following VBA, but for some reason it's no longer working. I'm using Excel version 16.71.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("C18, D18, E18")) Is Nothing Then Worksheets(Target.Value).Visible = xlSheetVisible
Application.EnableEvents = True
End sub
Any help to resolve this would be appreciated.