Private Sub Worksheet_Activate()
Dim d As Object, tablo, i&, resu(), x$, n&
Set d = CreateObject("Scripting.Dictionary")
d.CompareMode = vbTextCompare 'la casse est ignorée
With [TabRecap] 'tableau structuré
tablo = .Resize(, 4) 'matrice,plus rapide
For i = 1 To UBound(tablo)
d(tablo(i, 1)) = tablo(i, 4) 'mémorise le Type paiement
Next i
tablo = [TabPL].Resize(, 7) 'matrice,plus rapide
ReDim resu(1 To UBound(tablo), 1 To 4)
For i = 1 To UBound(tablo)
x = tablo(i, 1)
If x <> "" Then
n = n + 1
resu(n, 1) = x
resu(n, 2) = tablo(i, 5)
resu(n, 3) = Format(tablo(i, 6), "d/m/yy") & " " & Format(tablo(i, 7), "d/m/yy")
resu(n, 4) = d(x) 'récupère le Type paiement
End If
Next i
If n Then .Resize(n, 4) = resu 'restitution
If n < .Rows.Count Then If Not .ListObject.DataBodyRange Is Nothing Then .Rows(n + 1).Resize(.Rows.Count - n).Delete xlUp 'RAZ en desssous
End With
End Sub