Sub Séparation()
Dim DerniereLigne As Long
Dim DerniereRef As Long
Dim Nomfichier As String
Dim i As Integer
Dim j As Integer
DerniereLigne = Range("a" & Rows.Count).End(xlUp).Row
For i = 1 To DerniereLigne
Cells(i, 4).Value = Left(Cells(i, 2), InStr(Cells(i, 2).Value, " ") - 1)
Next
Range(Cells(2, 4), Cells(DerniereLigne, 4)).Copy
Cells(1, 6).Select
ActiveSheet.Paste
ActiveSheet.Range(Cells(1, 6), Cells(DerniereLigne - 1, 6)).RemoveDuplicates Columns:=1, Header:=xlNo
DerniereRef = Range("F" & Rows.Count).End(xlUp).Row
For j = 1 To DerniereRef
Range("A:D").Select
Selection.AutoFilter Field:=4, Criteria1:=Cells(j, 6).Value
Nomfichier = Cells(j, 6)
Columns("A:D").Select
Application.CutCopyMode = False
Selection.Copy
Workbooks.Add
Range("A1").Activate
ActiveSheet.Paste
Columns("B:B").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Columns("C:C").Select
Selection.Delete Shift:=xlToLeft
Rows("1:1").Select
Selection.Delete Shift:=xlUp
ChDir "C:\Users\TETCHOUNIE\Desktop\"
ActiveWorkbook.SaveAs Filename:=Nomfichier, _
FileFormat:=xlText, CreateBackup:=False
ActiveWorkbook.Save
ActiveWindow.Close
Next
End Sub