@ mario_82 ....ci-dessous ton code ... avec les balises Code ...
Private Sub CommandButton1_Click()
If txtuser = "" Then
MsgBox "Veuillez renseigner un utilisateur"
Exit Sub
End If
If txtpwd = "" Then
MsgBox "Veuillez renseigner un mot de passe"
Exit Sub
End If
If txtpwd <> "ton mot de passe" Then
MsgBox " Mot de passe erroné, veuillez recommencer"
Call vider
Exit Sub
Else
Call afficher
End If
End Sub
Private Sub afficher()
Dim cptr As Byte
For cptr = 1 To ThisWorkbook.Sheets.Count
Sheets(cptr).Visible = 1
Next cptr
End Sub
Private Sub vider()
Dim OL As OLEObject
With Worksheets("ACCES")
For Each OL In .OLEObjects
If TypeName(OL.Object) = "TextBox" Then
OL.Object.Text = ""
End If
Next OL
End With
End Sub