Sub CopieFeuille(Fs As Worksheet, Fa As Worksheet)
'Fs feuille source, Fa feuille active
Dim Rs As Range, Ra As Range, ts, ta, ub&, t1(), t2(), d As Object, i&, x$, y$, p As Byte, n&
Set Rs = Fs.Range("A6:D" & Application.Match("zzz", Fs.[A:A]))
Set Ra = Fa.Range("A6:D" & Application.Match("zzz", Fa.[A:A]))
If Rs.Row < 6 Then Set Rs = Fs.[A6:D6]
If Ra.Row < 6 Then Set Ra = Fa.[A6:D6]
ts = Rs: ta = Ra 'matrices, plus rapides
ub = UBound(ta)
ReDim t1(1 To Fa.Rows.Count, 1 To 1)
ReDim t2(1 To Fa.Rows.Count, 1 To 5)
'---analyse de ta et des doublons---
Set d = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(ta)
x = ta(i, 1) & Chr(1) & ta(i, 4)
d(x) = d(x) & i & " " 'mémorisation des n° de lignes concaténés
Next
'---remplissage de t1 et t2---
For i = 1 To UBound(ts)
x = ts(i, 1) & Chr(1) & ts(i, 4)
y = d(x)
If y <> "" Then
p = InStr(y, " ") 'permer d'isoler le 1er n° de ligne
t1(Left(y, p - 1), 1) = i
d(x) = Mid(y, p + 1) 'le n° est retiré de la liste
GoTo 1
End If
n = n + 1 'nouvelle ligne
t2(n, 1) = i: t2(n, 2) = ts(i, 1): t2(n, 5) = ts(i, 4)
1 Next i
'---restitutions---
Application.ScreenUpdating = False
Application.CutCopyMode = 0 'interdit le Copier-Coller
If Fa.FilterMode Then Fa.ShowAllData 'si la feuille est filtrée
Fa.Columns(1).Insert 'insertion colonne A auxiliaire
Ra.Columns(0) = t1 'restitution1
If n Then Ra(Ra.Rows.Count + 1, 0).Resize(n, 5) = t2 'restitution2
Set Ra = Ra(1, 0).Resize(Ra.Rows.Count + n, 8) 'redimensionne Ra
Ra.Sort Ra(1), xlAscending, Header:=xlNo 'tri sur la colonne auxiliaire
On Error Resume Next 'si aucune cellule vide
Ra.Columns(1).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Fa.Columns(1).Delete
With Fa.UsedRange: End With 'actualise la barre de défilement verticale
End Sub