Bonjour à tous.
J’utilise actuellement la macro pour verrouiller et déverrouiller l’intégralité des pages de mon tableau:
Sub ProtectDeprotect()
Dim ws As Worksheet
For Each ws In Worksheets
Select Case ws.ProtectContents
Case True
ws.Unprotect
Case False
ws.Protect
End Select
Next
End Sub
Y-at-il un moyen de la modifier pour que lors du verrouillage, “Format des cellules” dans les options: “PERMETTRE AUX UTILISATEURS DE CETTE FEUILLE D’EFFECTUER LES TACHES SUIVANTES” soit automatiquement sélectionné? ( voir pièce jointe)
Tu peux essayer avec ce code :
Sub ProtectDeprotect()
Dim ws As Worksheet
For Each ws In Worksheets
Select Case ws.ProtectContents
Case True
ws.Unprotect
Case False
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True, AllowFormattingCells:=True
End Select
Next
End Sub