Private Sub CommandButton1_Click()
Dim coded As Variant, dat As Variant
Dim i as integer, j as integer, r as integer
Sheets('feuil1').Visible = True
For i = Sheets('feuil1').Range('A65536').End(xlUp).Row To 5 Step -1
With Sheets('feuil1')
coded = .Cells(i, 2).Value
dat = .Cells(i, 1).Value
End With
Sheets('feuil2').Visible = True
With Sheets('feuil2')
For j = .Range('IV2').End(xlToLeft).Column To 1 Step -1
If .Cells(2, j).Value = coded Then
For r = .Range('A65536').End(xlUp).Row To 2 Step -1
If dat < .Cells(r, 1).Value Then GoTo puis
If coded = .Cells(2, j).Value Then
Cells(r, j).Value = Cells(r, j).Value + 1
Cells(r, j).Interior.ColorIndex = 4
GoTo nextdoss
End If
puis:
Next r
End If
Next j
End With
nextdoss:
Next i
End Sub