Option Explicit
Sub Archive_donnees()
Dim LOtDon As ListObject, LOtArc As ListObject, TDonn(), LDIni As Long, LDRes As Long, TArch(), LArch As Long, C As Long
Set LOtDon = Sheets("Depart").ListObjects("Depart")
Set LOtArc = Sheets("Arrivee").ListObjects("Arrivee")
TDonn = LOtDon.DataBodyRange.Value
ReDim TArch(1 To UBound(TDonn), 1 To UBound(TDonn, 2))
For LDIni = 1 To UBound(TDonn, 1)
If Year(TDonn(LDIni, 1)) <> Year(Date) Then
LArch = LArch + 1
For C = 1 To UBound(TDonn, 2): TArch(LArch, C) = TDonn(LDIni, C): Next C
Else
LDRes = LDRes + 1
For C = 1 To UBound(TDonn, 2): TDonn(LDRes, C) = TDonn(LDIni, C): Next C
End If
Next LDIni
If LDRes < LOtDon.ListRows.Count Then
LOtDon.ListRows(LDRes + 1).Range.Resize(LOtDon.ListRows.Count - LDRes).Delete xlShiftUp
If LDRes > 0 Then LOtDon.DataBodyRange.Value = TDonn
End If
If LArch > 0 Then
LOtArc.ListRows.Add.Range.Resize(LArch).Value = TArch
End If
End Sub