Hello,

I can't seem to get my code below to work if the user selects No for MSG1 and I'm not entirely sure why. Everything else works correctly, but if you select No it still takes you to MSG2. Any ideas?

MSG1 = MsgBox("Do you wish to perform action?", vbYesNo, "Confirmation Prompt")
MSG2 = InputBox("Please enter the security password:", "Security Check")

If MSG1 = vbYes Then
    If MSG2 = "correct password" Then
        'Action Code Here Removed
    
    Else
    MsgBox "Incorrect Password"
    Exit Sub
    End If
    
   
ElseIf MSG1 = vbNo Then
  MsgBox "Action Canceled"
End If