samsilverman
Board Regular
- Joined
- Nov 9, 2009
- Messages
- 176
I have a message box that pops up with a warning message every time a user activates a worksheet (PATIENT). It works great.
I also have a button on the main worksheet (ACCOUNT) that allows me to unprotect or protect every worksheet when the button is clicked. It also works great.
Of course now when I click on the Unprotect/Protect button, the message box pops up when it gets to the PATIENT worksheet. That's kind of annoying. Is there a way to have the protect/unprotect codes virtually hit the "OK" button on the msgbox instead of having to do it manually each time?
The unprotect coding is:
Thanks for any help! I'm assuming any add-on coding for the unprotect coding would work in the protect coding as well as they are pretty much the same.
I also have a button on the main worksheet (ACCOUNT) that allows me to unprotect or protect every worksheet when the button is clicked. It also works great.
Of course now when I click on the Unprotect/Protect button, the message box pops up when it gets to the PATIENT worksheet. That's kind of annoying. Is there a way to have the protect/unprotect codes virtually hit the "OK" button on the msgbox instead of having to do it manually each time?
The unprotect coding is:
Code:
Private Sub CommandButton2_Click()
Sheets("AREAS").Select
ActiveSheet.Unprotect Password:="areas"
Sheets("INVOICE").Select
ActiveSheet.Unprotect Password:="invoice"
Sheets("VENTILATION").Select
ActiveSheet.Unprotect Password:="ventilation"
Sheets("CHEMICAL").Select
ActiveSheet.Unprotect Password:="chemical"
Sheets("PATIENT").Select
ActiveSheet.Unprotect Password:="patient"
Sheets("MEDGAS").Select
ActiveSheet.Unprotect Password:="medgas"
Sheets("ACCOUNT").Select
ActiveSheet.Unprotect Password:="account"
Range("A1").Select
End Sub
Thanks for any help! I'm assuming any add-on coding for the unprotect coding would work in the protect coding as well as they are pretty much the same.