Can someone tell me why this is not working? The username input box pops up correctly and only accepts the 3 valid entries, but when the password box pops up, no matter what I put in there it keeps coming back with the incorrect password messagebox... even if the password is correct.
Or if there is a simpler way to do this, please fell free to correct it.
Thanks
Or if there is a simpler way to do this, please fell free to correct it.
Thanks
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("C27")) Is Nothing Then
User: UserName = Application.InputBox("Please enter username.", "Username", vbOKCancel)
If UserName = 0 Then Exit Sub
Select Case UserName
Case "Jeff Sheely"
PWordJS: Password = Application.InputBox("Please enter Password.", "Password", vbOKCancel)
If Password = 0 Then Exit Sub
If Passord = "JSheely" Then
ActiveSheet.Pictures.Insert( _
"S:\SERVICE\Shop Teardown Reports\Teardown Templates\New Teardown Pictures\Signature1.jpg" _
).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Width = 168#
Selection.ShapeRange.Height = 15#
Selection.ShapeRange.IncrementTop 2.25
Selection.ShapeRange.IncrementLeft 0.75
Else:
MsgBox "You have entered an incorrect password.", vbOKOnly, "Incorrect Password"
GoTo PWordJS
End If
Case "Dan Madison"
PWordDM: Password = Application.InputBox("Please enter Password.", "Password", vbOKCancel)
If Password = 0 Then Exit Sub
If Passord = "DMadison" Then
ActiveSheet.Pictures.Insert( _
"S:\SERVICE\Shop Teardown Reports\Teardown Templates\New Teardown Pictures\Signature1.jpg" _
).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Width = 168#
Selection.ShapeRange.Height = 15#
Selection.ShapeRange.IncrementTop 2.25
Selection.ShapeRange.IncrementLeft 0.75
Else:
MsgBox "You have entered an incorrect password.", vbOKOnly, "Incorrect Password"
GoTo PWordDM
End If
Case "Mike Andrews"
PWordMA: Password = Application.InputBox("Please enter Password.", "Password", vbOKCancel)
If Password = 0 Then Exit Sub
If Passord = "MAndrews" Then
ActiveSheet.Pictures.Insert( _
"S:\SERVICE\Shop Teardown Reports\Teardown Templates\New Teardown Pictures\Signature1.jpg" _
).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Width = 168#
Selection.ShapeRange.Height = 15#
Selection.ShapeRange.IncrementTop 2.25
Selection.ShapeRange.IncrementLeft 0.75
Else:
MsgBox "You have entered an incorrect password.", vbOKOnly, "Incorrect Password"
GoTo PWordMA
End If
Case Else:
MsgBox "You have not entered a valid Username.", vbOKOnly, "Invalid Username"
Sheets("Home").Range("C37").Value = ""
GoTo User
End Select
End If
End Sub