Sub Déprotège_Zone_Jaune()
'MJ
ActiveSheet.Unprotect
Range("A1").Select
Cells.Select
Selection.Locked = True
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
ActiveWorkbook.Names.Add Name:="zone", RefersToR1C1:=Selection() '_"=DEMO_xld!R1C1:R353C17"
For Each cell In Range("zone")
cell.Select
If Selection.Interior.ColorIndex = 36 Then Selection.Locked = False
Next
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False
Cells(1, 1).Select
End Sub
Sub Déprotège_Zone_Jaune_Sans_Select()
'MJ
ActiveSheet.Unprotect
Range("A1").Select
Cells.Select
Selection.Locked = True
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
ActiveWorkbook.Names.Add Name:="zone", RefersToR1C1:=Selection() '_"=DEMO_xld!R1C1:R353C17"
For Each cell In Range("zone")
'cell.Select
If cell.Interior.ColorIndex = 36 Then cell.Locked = False
Next
ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:=False
Cells(1, 1).Select
End Sub
Sub Trouve_Couleur()
MsgBox Selection.Interior.ColorIndex
End Sub