Option Explicit
Sub Zonecombinée44_QuandChangement()
Extraire Feuil1.[K6].Value ' ?, ?
End Sub
Sub Extraire(Optional ByVal Ville As String, Optional ByVal DateMin As Date, Optional ByVal DateMax As Date)
Dim Te() As Variant, Le As Long, Ts() As Variant, Ls As Long, C As Long
If DateMax = 0 Then DateMax = DateSerial(9999, 12, 31)
Ville = UCase(Ville)
Te = Feuil2.Range("A2:I" & Feuil2.[A65000].End(xlUp).Row)
ReDim Ts(1 To UBound(Te, 1), 1 To UBound(Te, 2))
For Le = 1 To UBound(Te, 1)
If Ville <> "" Then If UCase(Te(Le, 2)) <> Ville Then GoTo S
If Te(Le, 4) < DateMin Then GoTo S
If Te(Le, 4) > DateMax Then GoTo S
Ls = Ls + 1: For C = 1 To UBound(Te, 2): Ts(Ls, C) = Te(Le, C): Next C
Ts(Ls, 4) = Format(Te(Le, 4), "dd mmm yyyy") ' Palliatif au gravisseme bogue toujours encore ignoré de Microsoft
S: Next Le
Application.Calculation = xlCalculationManual
Feuil1.[I8:Z5000].ClearContents
Feuil1.[I9].Resize(Ls, UBound(Ts, 2)).Value = Ts
Application.Calculation = xlCalculationAutomatic
End Sub