Bonjour,
J'utilise ce code :
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim Cel, Plage As Range
Set Plage = ActiveSheet.Range("B2:Y221")
ActiveSheet.Unprotect
For Each Cel In Plage
If Cel.Interior.ColorIndex <> -4142 Then
If Cel.Locked = False Then Cel.Locked = True
End If
Next
ActiveSheet.Protect
End Sub
Mais rien ne se produit !
Avez vous une solution ?
Merci
J'utilise ce code :
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim Cel, Plage As Range
Set Plage = ActiveSheet.Range("B2:Y221")
ActiveSheet.Unprotect
For Each Cel In Plage
If Cel.Interior.ColorIndex <> -4142 Then
If Cel.Locked = False Then Cel.Locked = True
End If
Next
ActiveSheet.Protect
End Sub
Mais rien ne se produit !
Avez vous une solution ?
Merci