Sub toto()
Dim i%, j%, k%, d As Date, ri(), rt(), s(1 To 16, 1 To 14)
With Feuil9.[RV]
ri = .Value
.Sort Key1:=.Cells(1, 1), Order1:=xlAscending, Key2:=.Cells(1, 2), Order2:=xlAscending, Header:=xlYes
rt = .Value
.Value = ri
End With
Erase ri
With Feuil2
With .[SemAct]
For i = 1 To .Areas.Count
On Error Resume Next
d = .Areas(i).Value
If Err.Number = 0 Then
k = 0
For j = 2 To UBound(rt)
If rt(j, 1) = d Then
k = k + 1
s(k, 2 * i - 1) = rt(j, 2)
s(k, 2 * i) = rt(j, 3)
End If
Next
End If
Next
End With
Application.EnableEvents = False
.[Sem].Value = s
Application.EnableEvents = True
End With
End Sub