Excel Tips: VBA Code For Password For Dropdown List (Useful For Purchase Order)
Excel Tips: VBA Code For Password For Dropdown List (Useful For Purchase Order)
VBA Code for Password for Dropdown List (Useful for Purchase Order)
Basically, this is useful for people who needs a purchase order to come up with a unique password for
each name for listed in the "Requester” (or anything for that matter). Only RELEVANT for dropdown
list. Therefore you have to create a dropdown list for the “Requester”. The code is written in such a
way whenever you click on it, it will prompt you to enter password.Different names requires different
password, otherwise it will return as a blank cell.
To implement this, use shotcut key Alt+F11 when in excel to launch VBA. Sample names Mike,
Alan,Bob and Pete is used to simulate the case. Feel free to change the name and password.
VBA code:
Option Explicit
Const Mike As String = "Mike1"
Const Alan As String = "Alan1"
Const Bob As String = "Bob1"
Const Pete As String = "Pete1"
Application.EnableEvents = False
If Oops Then
MsgBox "Bad password"
cell = ""
End If
End If
Next cell
Application.EnableEvents = True
End Sub