1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| Sub Changer_Mdp()
Dim Oldpw As String, Newpw1 As String, Newpw2 As String
If Range("IV65535").Value = "" Then
MsgBox "Aucun mot de passe n'est créé pour l'instant, veuillez introduire votre nouveau mot de passe"
Range("IV65535") = InputBox("Nouveau de passe", "Création MDP")
ActiveWorkbook.Save
End If
recom:
Oldpw = InputBox("Veuillez introduire votre ancien mot de passe", "Old Password")
If Oldpw <> Range("IV65535") Then
If MsgBox("Mot de passe non valide, voulez-vous réessayer ?", vbExclamation + vbRetryCancel, "Invalide Password") = vbRetry Then
GoTo recom
Else
Exit Sub
End If
Else
Newpw1 = InputBox("Veuillez introduire votre nouveau mot de passe", "New Password")
Newpw2 = InputBox("Pour vérification, veuillez introduire une seconde fois votre nouveau mot de passe", "Nex Password")
If Newpw1 <> Newpw2 Then
If MsgBox("Erreur lors de la vérification, voulez-vous recommencer ?", vbExclamation + vbRetryCancel, "Vérification") = vbRetry Then
GoTo recom
Else
Exit Sub
End If
Else
Range("IV65535") = Newpw2
ActiveWorkbook.Save
UserForm1.Show
End If
End If
End Sub |
Partager