Hello,
I wrote the following code to automatically hide/unhide the relevant worksheets based on a dropdown menu selection. However, I also want to protect the workbook so that my "Control" worksheet (not in the code) can never be unhidden and also so that no users can delete any of the worksheets.
Private Sub Worksheet_Change(ByVal Target As Range)
If ['Info-Setup'!$J$10] = "Template style" Then
Sheets("Input").Visible = True
Sheets("Plates-Input").Visible = False
Sheets("Plates-Data").Visible = False
Sheets("Validity").Visible = True
Sheets("Excel").Visible = True
ElseIf ['Info-Setup'!$J$10] = "Plate style" Then
Sheets("Input").Visible = False
Sheets("Plates-Input").Visible = True
Sheets("Plates-Data").Visible = True
Sheets("Validity").Visible = True
Sheets("Excel").Visible = True
ElseIf ['Info-Setup'!$J$10] = "" Then
Sheets("Input").Visible = False
Sheets("Plates-Input").Visible = False
Sheets("Plates-Data").Visible = False
Sheets("Validity").Visible = False
Sheets("Excel").Visible = False
End If
End Sub
After I locked the workbook, unfortunately my dropdown menu stopped working; upon selecting any of the dropdown options, I got the debug message.
Is there any way to deal with this situation?
I wrote the following code to automatically hide/unhide the relevant worksheets based on a dropdown menu selection. However, I also want to protect the workbook so that my "Control" worksheet (not in the code) can never be unhidden and also so that no users can delete any of the worksheets.
Private Sub Worksheet_Change(ByVal Target As Range)
If ['Info-Setup'!$J$10] = "Template style" Then
Sheets("Input").Visible = True
Sheets("Plates-Input").Visible = False
Sheets("Plates-Data").Visible = False
Sheets("Validity").Visible = True
Sheets("Excel").Visible = True
ElseIf ['Info-Setup'!$J$10] = "Plate style" Then
Sheets("Input").Visible = False
Sheets("Plates-Input").Visible = True
Sheets("Plates-Data").Visible = True
Sheets("Validity").Visible = True
Sheets("Excel").Visible = True
ElseIf ['Info-Setup'!$J$10] = "" Then
Sheets("Input").Visible = False
Sheets("Plates-Input").Visible = False
Sheets("Plates-Data").Visible = False
Sheets("Validity").Visible = False
Sheets("Excel").Visible = False
End If
End Sub
After I locked the workbook, unfortunately my dropdown menu stopped working; upon selecting any of the dropdown options, I got the debug message.
Is there any way to deal with this situation?