'Constante paramètres de protection des feuilles (https://docs.microsoft.com/fr-fr/office/vba/api/excel.worksheet.protect)
Public Const DrawingObjects = True
Public Const Contents = True
Public Const Scenarios = True
Public Const UserInterfaceOnly = False
Public Const AllowFormattingCells = True
Public Const AllowFormattingColumns = False
Public Const AllowFormattingRows = False
Public Const AllowInsertingColumns = False
Public Const AllowInsertingRows = False
Public Const AllowInsertingHyperlinks = False
Public Const AllowDeletingColumns = False
Public Const AllowDeletingRows = False
Public Const AllowSorting = True
Public Const AllowFiltering = True
Public Const AllowUsingPivotTables = False
'
Public const MotDePasse = "MotDePasse"
'
'------------------------
'Protection d'une feuille
'------------------------
Sub Protect(WS As Worksheet)
WS.Protect Password:=MotDePasse, _
DrawingObjects:=DrawingObjects, _
Contents:=Contents, _
Scenarios:=Scenarios, _
UserInterfaceOnly:=UserInterfaceOnly, _
AllowFormattingCells:=AllowFormattingCells, _
AllowFormattingColumns:=AllowFormattingColumns, _
AllowFormattingRows:=AllowFormattingRows, _
AllowInsertingColumns:=AllowInsertingColumns, _
AllowInsertingRows:=AllowInsertingRows, _
AllowInsertingHyperlinks:=AllowInsertingHyperlinks, _
AllowDeletingColumns:=AllowDeletingColumns, _
AllowDeletingRows:=AllowDeletingRows, _
AllowSorting:=AllowSorting, _
AllowFiltering:=AllowFiltering, _
AllowUsingPivotTables:=AllowUsingPivotTables
End Sub