1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Sub ProtectionFeuilles()
ActiveWorkbook.Protect structure:=True 'Protection de la structure du classeur
'- cas de l'onglet paramétrage
With Worksheets("parametrage")
.Unprotect
.Cells.Locked = False
.Range(Cells(1, 1), Cells(1, 4)).Locked = True 'protection tableau 1
.Range(Cells(4, 1), Cells(4, 3)).Locked = True 'protection tableau 2
.Range(Cells(5, 1), Cells(6, 1)).Locked = True 'protection tableau 2
.Range(Cells(9, 1), Cells(9, 8)).Locked = True 'protection tableau 3
.Range(Cells(10, 1), Cells(11, 2)).Locked = True 'protection tableau 3
.Range(Cells(12, 1), Cells(15, 1)).Locked = True 'protection tableau 3
.Protect
End With
'- cas de l'onglet seuils
With Worksheets("Seuils de notation")
.Unprotect
.Cells.Locked = False
.Range(Cells(2, 1), Cells(3, 50)).Locked = True 'protection des lignes 1 à 3
.Range(Cells(1, 1), Cells(1, 65535)).Locked = True 'protection colonne 1
.Protect
End With
End Sub |
Partager