Private Sub Workbook_Open()
mesheetspastouche = Array("toto", "titi") 'array de nom de sheets a proteger contre la modification de nom ( peut y en avoir qu'un)
For i = LBound(mesheetspastouche) To UBound(mesheetspastouche)
With Sheets(mesheetspastouche(i))
If .CustomProperties.Count > 0 Then .CustomProperties(1).Delete
.CustomProperties.Add "nom", .Name
End With
Next
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
For Each Sh In Worksheets
If Sh.CustomProperties.Count > 0 Then If Sh.Name <> Sh.CustomProperties(1) Then Sh.Name = Sh.CustomProperties(1)
Next
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If Sh.CustomProperties.Count > 0 Then If Sh.Name <> Sh.CustomProperties(1) Then Sh.Name = Sh.CustomProperties(1)
End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
If Sh.CustomProperties.Count > 0 Then If Sh.Name <> Sh.CustomProperties(1) Then Sh.Name = Sh.CustomProperties(1)
End Sub