Sub filtre()
Set f = Sheets("bd")
' Tbl1 = tableau 2D (bd)
Tbl1 = f.Range("A2:D" & f.[A65000].End(xlUp).Row).Value
ville = "Paris"
n = 0
' Tbl2 = tableau 2D (Ligne corespond à la ville Paris: Nom/Age/Ville/Date)
Dim Tbl2()
' Tbl2Bis = tableau 2D (1 colonne par n Ligne corespond à la ville Paris: Ville)
Dim Tbl2Bis()
' Tbl4 = tableau 1D (Colonne corespond à la ville Paris: Ville)
Dim Tbl4()
For i = LBound(Tbl1, 1) To UBound(Tbl1, 1) ' Boucle Ligne
If Tbl1(i, 3) = ville Then ' Ligne i colonne 3
n = n + 1
' Tbl2 = tableau 2D (4 Colonnes par n Lignes)
ReDim Preserve Tbl2(LBound(Tbl1, 2) To UBound(Tbl1, 2), LBound(Tbl1, 1) To n)
For k = LBound(Tbl1, 2) To UBound(Tbl1, 2)
Tbl2(k, n) = Tbl1(i, k)
Next k
' Tbl2Bis = tableau 2D (1 Colonnes par n Lignes)
ReDim Preserve Tbl2Bis(LBound(Tbl1, 2) To LBound(Tbl1, 2), LBound(Tbl1, 1) To n)
Tbl2Bis(1, n) = Tbl1(i, 3)
' Tbl4 = tableau 1D
ReDim Preserve Tbl4(n - 1)
Tbl4(n - 1) = Tbl1(i, 3)
End If
Next i
' 1)
Tbl3 = Application.Transpose(Tbl2)
f.[G2].Resize(UBound(Tbl3, 1), UBound(Tbl3, 2)) = Tbl3
' 2)
f.[Q2].Resize(UBound(Tbl4) + 1) = Tbl4
' 3)
Tbl2Bis = Application.Transpose(Tbl2Bis)
f.[R2].Resize(UBound(Tbl2Bis, 1), UBound(Tbl2Bis, 2)) = Tbl2Bis
End Sub