Sub protection()
With ActiveSheet
.Unprotect
With [ZoneTexteMessage]
.Locked = True ' par sécurité
.LockedText = True
.Interior.Color = 6737151 ' orange
End With
.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
.EnableSelection = xlNoSelection
End With
End Sub
Sub déprotege()
With ActiveSheet
.Unprotect
With [ZoneTexteMessage]
.Locked = True ' par sécurité
.LockedText = False
.Interior.Color = 9359785 ' vert clair
End With
.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
.EnableSelection = xlNoRestrictions
End With
With [ZoneTexteMessage].ShapeRange.TextFrame2.TextRange
.Characters(.Characters.Count, 0).Select
End With
End Sub