XL 2016 Macro Password

enzo_s

XLDnaute Junior
Bonjour à tous,

Je bloque sur un bout de macro qui je souhaiterais que, IF C25 = No tu continue sans password et If C25 = Yes tu dois mettre un password pour exécuté la macro

merci de l'aide

Enzo

VB:
Public repertoire As String
Sub ExportPRouter()
Dim Mdp As String
If [C25] = "No" Then MsgBox "NO SOS"
If [C25] = "Yes" And Mdp = Application.InputBox("Insert the password") Then
If Mdp <> "***" Then MsgBox "Access Denied !", vbCritical: Exit Sub
End If
 

Robert

XLDnaute Barbatruc
Repose en paix
Bonjour Enzo, bonjour le forum,

Essaie comme ça :

VB:
Sub ExportPRouter()
Dim Mdp As String

If [C25] = "No" Then MsgBox "NO SOS"
If [C25] = "Yes" Then
    Mdp = Application.InputBox("Insert the password")
    If Mdp <> "***" Then MsgBox "Access Denied !", vbCritical: Exit Sub
End If
MsgBox "Continuation de la macro..."
End Sub
 

Discussions similaires

Membres actuellement en ligne

Statistiques des forums

Discussions
312 493
Messages
2 088 956
Membres
103 990
dernier inscrit
lamiadebz