Bonjour,
A tester :
Sub Archiver()
Dim TArch(), n%, i%, j%, k%
With Worksheets("Tableau")
Application.ScreenUpdating = False
n = .Cells(.Rows.Count, 7).End(xlUp).Row
For i = 7 To n
If .Cells(i, 7) = "9 - TERMINER" Then
j = j + 1: ReDim Preserve TArch(1 To 5, 1 To j)
For k = 3 To 6
TArch(k - 2, j) = .Cells(i, k)
Next k
TArch(5, j) = .Cells(i, 8)
.Cells(i, 1).Resize(, 11).ClearContents
End If
Next i
.Range("A7:K" & n).Sort key1:=.Cells(7, 7), order1:=xlAscending, Header:=xlNo
Application.ScreenUpdating = True
End With
With Worksheets("Archive")
n = 0
For k = 1 To 5
j = .Cells(.Rows.Count, k).End(xlUp).Row
n = IIf(j > n, j, n)
Next k
.Cells(n + 1, 1).Resize(UBound(TArch, 2), 5).Value = WorksheetFunction.Transpose(TArch)
End With
End Sub
NB- N'étant pas garanti que les 5 valeurs à archiver par ligne soient toutes saisies lors de l'archivage,la détermination de la première ligne à utiliser sur Archive tient compte de toutes les colonnes (par sécurité).
La méthode ne procède pas par copier-coller, mais par constitution d'un tableau, affecté globalement...
Les lignes archivées sont effacées, et le tableau est retrié sur la colonne G.
Cordialement.