Private Sub OK_Click()
Application.ScreenUpdating = False
Dim l As Integer, Col As Integer, ColCible As Byte
With Worksheets("Feuil1")
For Col = 4 To 16
If Me.CBx1.Value = .Cells(4, Col) Then ColCible = Col: Exit For
Next Col
For l = 12 To 743
If Weekday(CDate(.Cells(l, 2)), vbMonday) < 6 Then
If CDate(Me.CBx3.Value) = CDate(.Cells(l, 2)) And Me.CBx4.Value = .Cells(l, 3) Then
.Cells(l, ColCible) = "CP"
ElseIf CDate(.Cells(l, 2)) > CDate(Me.CBx3.Value) And CDate(.Cells(l, 2)) < Me.CBx6.Value Then
.Cells(l, ColCible) = "CP"
ElseIf CDate(Me.CBx6.Value) = CDate(.Cells(l, 2)) And Me.CBx7.Value = .Cells(l, 3) Then
.Cells(l, ColCible) = "CP"
If CDate(Me.CBx6.Value) = CDate(.Cells(l, 2)) Then Exit For
End If
End If
Next l
End With
Unload Me
End Sub