Sub protect_classeur()
Application.ScreenUpdating = False
MDP = InputBox("Entrer mot de passe :", "Activation de la protection des feuilles")
If MDP <> "toto" Then
MsgBox "Mot de passe incorrect", vbCritical + vbOKOnly, "Erreur"
Exit Sub
End If
If ThisWorkbook.ProtectStructure Or ThisWorkbook.ProtectWindows Then
ThisWorkbook.Unprotect "toto"
With Worksheets("BD")
.Visible = xlSheetVisible
.Activate
.Unprotect "toto"
End With
else
ThisWorkbook.Protect...