The entire code goes into the Worksheet module. Right click on the Sheet - View Code. This type of macro fires automatically. For each option in the dropdown, a password has been added(in red)
Const Mike As String = "Mike1"
Range B7 is the dropdown and were the paswword rules should apply.
pwd = Application.InputBox("Password for " & cell & ":", _
"Enter Password", Type:=2)
This opens the input box to write the password.
Finally, this part deals with wrong passwords. If the password is incorrect, it won't give the user access.
Case "Mike"
If pwd <> Mike Then Oops = True
Case "Bob"
If pwd <> Bob Then Oops = True
Case "Alan"
If pwd <> Alan Then Oops = True
Case "Pete"
If pwd <> Pete Then Oops = True
End Select
If Oops Then
MsgBox "Bad password"
cell = ""
End If
But you will need to password protect the codes as well.
You can upload a sample file if you need more help.
Bookmarks