Sub Ventiler()
Dim t, k&, i&, n&, j&, wbk As Workbook
Application.ScreenUpdating = False
With Worksheets("BDD")
For k = 1 To 5
t = .Range("a1:k" & .Cells(Rows.Count, "f").End(xlUp).Row)
n = 1
For i = 2 To UBound(t)
If t(i, 6) = k Then
n = n + 1
For j = 1 To UBound(t, 2): t(n, j) = t(i, j): Next j
End If
Next i
Set wbk = Workbooks.Add
wbk.Worksheets(1).Range("a1").Resize(n, UBound(t, 2)) = t
On Error Resume Next
wbk.SaveAs Filename:=ThisWorkbook.Path & "\Test" & k & " " & Format(Date, "dd-mm-yyyy ") & ".xlsx", FileFormat:=xlOpenXMLWorkbook
On Error GoTo 0
wbk.Close
Next k
End With
MsgBox "C'est fini !", vbInformation
End Sub