Private Sub Worksheet_Calculate()
ThisWorkbook.Sheets("Général").Unprotect "pfv201211"
Range(Cells(16, 10), Cells(16, 11)).Select
If ActiveSheet.FilterMode Then
With Selection.Interior
.ColorIndex = 46
.Pattern = x1Solid
.PatternColorIndex = x1Automatic
End With
Else:
With Selection.Interior
.ColorIndex = 35
.Pattern = x1Solid
.PatternColorIndex = x1Automatic
End With
End If
ThisWorkbook.Sheets("Général").Protect "pfv201211", True, True, True, AllowFiltering:=True, AllowSorting:=True
End Sub