Bonjour sans arret il me met un message erreur de style "IF" sans " bloc "end if", ou alors else sans if, alors que tout y figure, j'ai cherché sur les forum, et en interne mais la je séche
un coup de main ?
voici la macro
'mode administrateur
Private Sub CommandButton1_Click()
If TextBox1.Text = "12345" Then ThisWorkbook.Unprotect Sheets("Accueil").CommandButton4.Visible = False
If TextBox1.Text = "12345" Then UserForm2.Show
Sheets("Accueil").CommandButton7.Visible = True
'bouton deconnexion
Sheets("Accueil").CommandButton5.Visible = True
UserForm1.Hide
'mode gestionnaire
'visiblité sur tout mais aucune modification
If TextBox1 = "XXXXXXXX" Then Sheets("Accueil").CommandButton4.Visible = False
If TextBox1.Text = "XXXXXXXX" Then UserForm2.Show
Sheets("Accueil").CommandButton7.Visible = True
Sheets("Accueil").CommandButton5.Visible = True
If TextBox1 = "XXXXXXXX" Then Sheets("Accueil").CommandButton4.Visible = False
If TextBox1.Text = "XXXXXXXX" Then UserForm2.Show
Sheets("Accueil").CommandButton7.Visible = True
Sheets("Accueil").CommandButton5.Visible = True
MsgBox "mot de passe incorrect", vbOKOnly + vbExclamation
Sheets("Accueil").CommandButton7.Visible = False
Sheets("Accueil").CommandButton5.Visible = False
'Exit Sub
End If
End Sub