Private Sub Worksheet_Activate()
With Sheets("Grilles").[K3:K43200]
.Formula = "=IF(J3="""","""",IF(OR(COUNTIF(P3:P92,A3)+COUNTIF(P3:P92,B3)+COUNTIF(P3:P92,C3)+COUNTIF(P3:P92,D3)" & _
"+COUNTIF(P3:P92,E3)+COUNTIF(P3:P92,F3)+COUNTIF(P3:P92,G3)+COUNTIF(P3:P92,H3)+COUNTIF(P3:P92,I3)=5,COUNTIF(P3:P92,A1)+COUNTIF(P3:P92,B1)" & _
"+COUNTIF(P3:P92,C1)+COUNTIF(P3:P92,D1)+COUNTIF(P3:P92,E1)+COUNTIF(P3:P92,F1)+COUNTIF(P3:P92,G1)+COUNTIF(P3:P92,H1)+COUNTIF(P3:P92,I1)=5," & _
"COUNTIF(P3:P92,A2)+COUNTIF(P3:P92,B2)+COUNTIF(P3:P92,C2)+COUNTIF(P3:P92,D2)+COUNTIF(P3:P92,E2)+COUNTIF(P3:P92,F2)+COUNTIF(P3:P92,G2)" & _
"+COUNTIF(P3:P92,H2)+COUNTIF(P3:P92,I2)=5),""QUINE"",""""))"
.Value = .Value 'supprime les formules
End With
With Sheets("Grilles").[L3:L43200]
.Formula = "=IF(J3="""","""",IF(AND(COUNTIF(P3:P92,A3)+COUNTIF(P3:P92,B3)+COUNTIF(P3:P92,C3)+COUNTIF(P3:P92,D3)+COUNTIF(P3:P92,E3)" & _
"+COUNTIF(P3:P92,F3)+COUNTIF(P3:P92,G3)+COUNTIF(P3:P92,H3)+COUNTIF(P3:P92,I3)=5,COUNTIF(P3:P92,A1)+COUNTIF(P3:P92,B1)+COUNTIF(P3:P92,C1)" & _
"+COUNTIF(P3:P92,D1)+COUNTIF(P3:P92,E1)+COUNTIF(P3:P92,F1)+COUNTIF(P3:P92,G1)+COUNTIF(P3:P92,H1)+COUNTIF(P3:P92,I1)=5,COUNTIF(P3:P92,A2)" & _
"+COUNTIF(P3:P92,B2)+COUNTIF(P3:P92,C2)+COUNTIF(P3:P92,D2)+COUNTIF(P3:P92,E2)+COUNTIF(P3:P92,F2)+COUNTIF(P3:P92,G2)+COUNTIF(P3:P92,H2)" & _
"+COUNTIF(P3:P92,I2)=5),""CARTON PLEIN"",IF(OR(AND(COUNTIF(P3:P92,A3)+COUNTIF(P3:P92,B3)+COUNTIF(P3:P92,C3)+COUNTIF(P3:P92,D3)+COUNTIF(P3:P92,E3)" & _
"+COUNTIF(P3:P92,F3)+COUNTIF(P3:P92,G3)+COUNTIF(P3:P92,H3)+COUNTIF(P3:P92,I3)=5,COUNTIF(P3:P92,A1)+COUNTIF(P3:P92,B1)+COUNTIF(P3:P92,C1)" & _
"+COUNTIF(P3:P92,D1)+COUNTIF(P3:P92,E1)+COUNTIF(P3:P92,F1)+COUNTIF(P3:P92,G1)+COUNTIF(P3:P92,H1)+COUNTIF(P3:P92,I1)=5),AND(COUNTIF(P3:P92,A1)" & _
"+COUNTIF(P3:P92,B1)+COUNTIF(P3:P92,C1)+COUNTIF(P3:P92,D1)+COUNTIF(P3:P92,E1)+COUNTIF(P3:P92,F1)+COUNTIF(P3:P92,G1)+COUNTIF(P3:P92,H1)" & _
"+COUNTIF(P3:P92,I1)=5,COUNTIF(P3:P92,A2)+COUNTIF(P3:P92,B2)+COUNTIF(P3:P92,C2)+COUNTIF(P3:P92,D2)+COUNTIF(P3:P92,E2)+COUNTIF(P3:P92,F2)" & _
"+COUNTIF(P3:P92,G2)+COUNTIF(P3:P92,H2)+COUNTIF(P3:P92,I2)=5),AND(COUNTIF(P3:P92,A3)+COUNTIF(P3:P92,B3)+COUNTIF(P3:P92,C3)+COUNTIF(P3:P92,D3)" & _
"+COUNTIF(P3:P92,E3)+COUNTIF(P3:P92,F3)+COUNTIF(P3:P92,G3)+COUNTIF(P3:P92,H3)+COUNTIF(P3:P92,I3)=5,COUNTIF(P3:P92,A2)+COUNTIF(P3:P92,B2)" & _
"+COUNTIF(P3:P92,C2)+COUNTIF(P3:P92,D2)+COUNTIF(P3:P92,E2)+COUNTIF(P3:P92,F2)+COUNTIF(P3:P92,G2)+COUNTIF(P3:P92,H2)+COUNTIF(P3:P92,I2)=5)),""DOUBLE QUINE"","""")))"
.Value = .Value 'supprime les formules
End With
End Sub