Hello, John!
You can use one technical password to operate with protection via VBA. And two user-oriented passwords that might be typed in Inputbox. In attachment you will see hidden list "Gear" with User and Admin passwords. "Admin" pass for admin and "User" for user.
Sub Protect()
ThisWorkbook.ActiveSheet.Protect Password:="You_Will_Never_I_repeat_Never_guess_This"
MsgBox "This sheet is protected."
End Sub
Sub Unprotect()
Dim strX As String
strX = InputBox("Type your password wherever it is User or Admin pass.", "Login in...", "Password")
With ThisWorkbook.Worksheets("Gear")
Select Case strX
Case .Cells(1, 1).Value: MsgBox "Welcome, Mr. Admin!"
Case .Cells(2, 1).Value: MsgBox "Welcome, dear User!"
Case Else: MsgBox "Your password is incorrect.": Exit Sub
End Select
End With
ThisWorkbook.ActiveSheet.Unprotect Password:="You_Will_Never_I_repeat_Never_guess_This"
End Sub
Bookmarks