I want to be able show a prompt to add in the password before being able to do the actions below.
Private SubToggleButton2_Click()
If ToggleButton2Then
ActiveSheet.UnprotectPassword
ToggleButton2.ForeColor = RGB(0, 0, 0)
ToggleButton2.Font.Bold = False
ToggleButton2.Caption = "Hide"
Rows("7:13").EntireRow.Hidden =True
Rows("26:29").EntireRow.Hidden =True
Rows("47:53").EntireRow.Hidden =True
Columns("E:R").EntireColumn.Hidden = True
ActiveSheet.Protect
Else
ActiveSheet.UnprotectPassword
ToggleButton2.ForeColor = RGB(0, 0, 255)
ToggleButton2.Font.Bold = True
ToggleButton2.Caption = "Unhide"
Rows("7:13").EntireRow.Hidden =False
Rows("26:29").EntireRow.Hidden =False
Rows("47:53").EntireRow.Hidden =False
Columns("E:R").EntireColumn.Hidden = False
ActiveSheet.Protect
End If
End Sub
Private SubToggleButton2_Click()
If ToggleButton2Then
ActiveSheet.UnprotectPassword
ToggleButton2.ForeColor = RGB(0, 0, 0)
ToggleButton2.Font.Bold = False
ToggleButton2.Caption = "Hide"
Rows("7:13").EntireRow.Hidden =True
Rows("26:29").EntireRow.Hidden =True
Rows("47:53").EntireRow.Hidden =True
Columns("E:R").EntireColumn.Hidden = True
ActiveSheet.Protect
Else
ActiveSheet.UnprotectPassword
ToggleButton2.ForeColor = RGB(0, 0, 255)
ToggleButton2.Font.Bold = True
ToggleButton2.Caption = "Unhide"
Rows("7:13").EntireRow.Hidden =False
Rows("26:29").EntireRow.Hidden =False
Rows("47:53").EntireRow.Hidden =False
Columns("E:R").EntireColumn.Hidden = False
ActiveSheet.Protect
End If
End Sub