Quentin62000
XLDnaute Nouveau
Bonjour a tous en cherchant sur le forum j'ai trouver cette formules pour verrouiller toute mes feuilles , cependant , il ne me demande pas de mdp pourquoi ??
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
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