Salut le forum
La macro qui fait tout. Le chemin du fichier est à adapter.
Sub CopierFichierTexte()
Dim Ligne As Single
On Error Resume Next
Cells.Delete
Range("A1").Select
Application.DisplayAlerts = False
Workbooks.OpenText "C:\Excel\Exemple.txt", xlWindows, _
1, xlDelimited, ConsecutiveDelimiter:=False, Tab:=True
Application.DisplayAlerts = True
If Err Then MsgBox Err.Description: Exit Sub
On Error GoTo 0
With Application
.ScreenUpdating = False
ActiveSheet.Cells.Copy
.DisplayAlerts = False
ActiveWorkbook.Close False
ActiveSheet.Paste
.CutCopyMode = False
.DisplayAlerts = True
End With
Range("A1").Select
Ligne = Columns(1).Find("*FUTURES CONFIRMATIONS*", [A1], , , , xlPrevious).Row
Range(Cells(1, 1), Cells(Ligne - 1, 1)).Delete
Ligne = Columns(1).Find("*STOCK OPTIONS CONFIRMATIONS*", [A1], , , , xlPrevious).Row
Range(Cells(Ligne, 1), Cells(Range("A65535").End(xlUp).Row, 1)).Delete
End Sub
Mytå