KP_SoCal
Board Regular
- Joined
- Nov 17, 2009
- Messages
- 116
With my code below you can see I set up a very non-secure means of executing certain commands based on the user names that are inputted.
As you can see, it's not very dynamic at all. I'd like to modify it to pull from a range of cells A2:A20 in worksheet "UserNames".
Any suggestions on how to tweak the code below to accommodate this would be greatly appreciated. Thanks again so much!
As you can see, it's not very dynamic at all. I'd like to modify it to pull from a range of cells A2:A20 in worksheet "UserNames".
Any suggestions on how to tweak the code below to accommodate this would be greatly appreciated. Thanks again so much!
Code:
Public Sub Test()
Dim myValue
Dim myIDa As String
Dim myIDb As String
Dim myIDc As String
Dim myIDd As String
myIDa = "Fred"
myIDb = "Bill"
myIDc = "Jane"
myIDd = "Abe"
myValue = InputBox("Input Authorized Name: ", "Authorization Confirmaton", )
If UCase(myValue) = myIDa Or UCase(myValue) = myIDb Or UCase(myValue) = myIDc Or UCase(myValue) = myIDd Then
MsgBox "Authorized"
ElseIf myValue = "" Then
Exit Sub
Else
MsgBox "Unauthorized"
End If
End Sub