Forum Discussion
Hiding sheets
- Jun 23, 2023
For this, only a VBA solution would be appropriate.
Here are some steps:
Alt+F11 to open the Visual Basic Editor
Locate the worksheet where you want to add 5 in A1 (i n file example ist Sheet1).
Enter the following code:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then ' Change A1 to the cell you want to monitor If Target.Value = 5 Then Sheets("Sheet2").Visible = xlSheetHidden ' Replace "Sheet2" with the actual name of the sheet Else Sheets("Sheet2").Visible = xlSheetVisible ' Replace "Sheet2" with the actual name of the sheet End If End If End SubClose the VBA Editor.
Your must use your workbook as a .xlsm file to retain the functionality.
Example file is included.
I hope that I could help you with this.
For this, only a VBA solution would be appropriate.
Here are some steps:
Alt+F11 to open the Visual Basic Editor
Locate the worksheet where you want to add 5 in A1 (i n file example ist Sheet1).
Enter the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then ' Change A1 to the cell you want to monitor
If Target.Value = 5 Then
Sheets("Sheet2").Visible = xlSheetHidden ' Replace "Sheet2" with the actual name of the sheet
Else
Sheets("Sheet2").Visible = xlSheetVisible ' Replace "Sheet2" with the actual name of the sheet
End If
End If
End Sub
Close the VBA Editor.
Your must use your workbook as a .xlsm file to retain the functionality.
Example file is included.
I hope that I could help you with this.