Bonjour,
J'ai un problème avec une demande de mot de passe pour l'obtention de certaines informations.
Mon code est le suivant:
En fait cela marche si dans la Inputbox je rentre le bon code ou un chiffre négatif.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 Sub autorisation() Dim i As Integer, j As Integer Workbooks(1).Worksheets("AGO").Unprotect "bbil" i = 0 i = CInt(InputBox("Veuillez entrer votre mot de passe :")) '''''' autorisation CODIR ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' If i = 12 Then Sheets("AGO").Visible = True Sheets("Listes").Visible = True Sheets("Liste_Mots_Clés").Visible = True Sheets("Statistiques").Visible = True Workbooks(1).Worksheets("AGO").Activate Cells.EntireRow.Hidden = False Else MsgBox "Vous n'avez pas accès aux décisions CODIR.", vbExclamation End If Workbooks(1).Worksheets("AGO").Protect "bbil" End Sub
Cependant, si je click sur annuler sans rien rentrer dans la box. Il y a un message d'erreur (incompatibilité). surement dû au Cint, je pense.
Si quelqu'un pouvait m'aider?![]()
Merci
Partager