Sub Import_Big_Fichier_TXT()
'code original de Anast - avril 2013
Const HelperFile As String = "tempo"
Const N As Long = 1000000 'nombre de lignes (modifiable)
Dim myPath$, myFile$, myStr$, t&, r&
Dim WB As Workbook, myWB As Workbook, myWS As Worksheet
Set myWB = ThisWorkbook
myPath = myWB.Path & "\"
myFile = "fichier.txt" 'mettre le nom du fichier réel
Application.ScreenUpdating = False
'split du gros fichier txt en plusieurs *.txt
myFile = Dir(myPath & myFile)
Open myPath & myFile For Input As #1
t = 1
r = 1
Do While Not EOF(1)
Line Input #1, myStr
If r > N Then
t = t + 1
r = 1
End If
Open myPath & HelperFile & t & ".txt" For Append As #2
Print #2, myStr
Close #2
r = r + 1
Loop
Close #1
'Copie des *.txt temporaires dans le classeur
For i = t To 1 Step -1
Workbooks.OpenText Filename:=myPath & HelperFile & i & ".txt", DataType:=xlDelimited, Tab:=True
Set WB = ActiveWorkbook
Set rng = ActiveSheet.UsedRange
Set myWS = myWB.Sheets.Add
myWS.Name = HelperFile & i
rng.Copy myWS.Cells(1, 1)
WB.Close False
Next
myWB.Save
'Effacement des fichiers *.txt temporaires
Set Fso = CreateObject("Scripting.FileSystemObject")
Set Fldr = Fso.GetFolder(myPath)
For Each Filename In Fldr.Files
If Filename Like "*" & HelperFile & "*" Then Filename.Delete
Next
Application.ScreenUpdating = True
End Sub