Public Sub AvecProtection()
Dim wsh As Worksheet
Dim myPassword As String
myPassword = "1234"
For Each wsh In Application.ThisWorkbook.Worksheets
wsh.Protect myPassword, UserInterfaceOnly:=True
Next wsh
MsgBox "Protection activée", vbInformation
End Sub
Public Sub SansProtection()
Dim wsh As Worksheet
Dim myPassword As String
myPassword = "1234"
For Each wsh In Application.ThisWorkbook.Worksheets
wsh.Unprotect myPassword
Next wsh
MsgBox "Protection désactivée", vbInformation
End Sub