VBA Bouton commande inactif + Mot de passe + message Feuille

Armand11

XLDnaute Occasionnel
Bonjour à toute la communauté Excel Download,

En cet veille de weekend prolongé je vous sollicite sur une commande VBA. En effet j'aimerai connaître une fonction simple pour désactiver un bouton de commande après 1 seul clic et de pouvoir le rendre inactif même après réouverture du fichier. On pourra le rendre actif par un mot de passe seulement.....

En plus je souhaiterai indiquer un message texte après le premier clic . Pour l'instant j'utilise "MsgBox" mais je préfère l'indiquer sur la feuille en dur....

Merci d'avance pour votre aide précieuse...

Armand
PS: je vous ai mis à dispo un petit fichier....

Mille mercis !
 

Pièces jointes

  • VBA Message Bouton clic 1 fois .xlsm
    27.6 KB · Affichages: 33

phlaurent55

Nous a quittés en 2020
Repose en paix
Bonjour Armand,

remplace ton code par celui-ci:
Code:
Sub macro1apo()
If InputBox("ENTREZ LE MOT DE PASSE") <> "TOTO" Then Exit Sub
Range("b7:b11").Copy Range("d7:d11")
MsgBox "Utilisé le " & Date
End Sub

ou celui-ci
Code:
Sub macro1apo()
If InputBox("ENTREZ LE MOT DE PASSE") <> "TOTO" Then Exit Sub
Range("b7:b11").Copy Range("d7:d11")
[B4] = "Utilisé le " & Date & " à " & Time
End Sub

ou celui-ci
Code:
Sub macro1apo()
If InputBox("ENTREZ LE MOT DE PASSE") <> "TOTO" Then
    MsgBox ("Le mot de passe n'est pas valable")
    Exit Sub
End If
Range("b7:b11").Copy Range("d7:d11")
[B4] = "Utilisé le " & Date & " à " & Time
End Sub

à+
Philippe
 
Dernière édition:

Armand11

XLDnaute Occasionnel
Bonjour Armand,

remplace ton code par celui-ci:
Code:
Sub macro1apo()
If InputBox("ENTREZ LE MOT DE PASSE") <> "TOTO" Then Exit Sub
Range("b7:b11").Copy Range("d7:d11")
MsgBox "Utilisé le " & Date
End Sub

ou celui-ci
Code:
Sub macro1apo()
If InputBox("ENTREZ LE MOT DE PASSE") <> "TOTO" Then Exit Sub
Range("b7:b11").Copy Range("d7:d11")
[B4] = "Utilisé le " & Date & " à " & Time
End Sub

ou celui-ci
Code:
Sub macro1apo()
If InputBox("ENTREZ LE MOT DE PASSE") <> "TOTO" Then
    MsgBox ("Le mot de passe n'est pas valable")
    Exit Sub
End If
Range("b7:b11").Copy Range("d7:d11")
[B4] = "Utilisé le " & Date & " à " & Time
End Sub

à+
Philippe
Bonjour à tous et bonjour Philippe

C'est juste Parfait et génial , tout marche !!
Merci beaucoup pour votre aide

Bon weekend !

Armand
 

Discussions similaires

Statistiques des forums

Discussions
312 177
Messages
2 085 969
Membres
103 072
dernier inscrit
Remithesix