1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| Sub D_DatesDebutMsn()
Application.ScreenUpdating = False
Worksheets("Feuil3").Range("A:B").ClearContents
Worksheets("data").Columns("D:G").NumberFormat = "General"
LastRow = Worksheets("data").Range("A60000").End(xlUp).Row
For i = 2 To LastRow
If Worksheets("data").Cells(i, 8).Value = "Oui" Then
first = Worksheets("data").Cells(i, 6).Value
vMsn = Worksheets("data").Cells(i, 2).Value
For j = 2 To LastRow
If j <> i Then
If Worksheets("data").Cells(j, 2).Value = Worksheets("data").Cells(i, 2).Value Then
If Worksheets("data").Cells(j, 6).Value < Worksheets("data").Cells(i, 6).Value Then
If Worksheets("data").Cells(j, 6).Value > 0 Then
first = Worksheets("data").Cells(j, 6).Value
vMsn = Worksheets("data").Cells(j, 2).Value
End If
End If
End If
End If
If first <> 0 Then
Worksheets("Feuil3").Cells(i, 1).Value = vMsn
Worksheets("Feuil3").Cells(i, 2).Value = first
End If
Next j
End If
Next i
Worksheets("data").Columns("D:G").NumberFormat = "m/d/yyyy"
Worksheets("Feuil3").Columns("B:B").NumberFormat = "m/d/yyyy"
Application.ScreenUpdating = True
End Sub |
Partager