Sub Fichier_TXT_import3()
Dim Resultat
Dim Chemin As Variant
Dim Fich As Integer
Dim Lecture As Integer
Dim Compteur As Variant
Chemin = Application.GetOpenFilename("Fichiers Texte,*.txt", , , , True)
If IsArray(Chemin) Then
For Fich = 1 To UBound(Chemin)
Lecture = FreeFile()
Open Chemin(Fich) For Input As #Lecture
Application.ScreenUpdating = False
Compteur = 1
Do While Seek(Lecture) <= LOF(Lecture)
Line Input #Lecture, Resultat
ActiveCell.Value = Resultat
ActiveCell.Replace What:=".", Replacement:=","
ActiveCell.TextToColumns , DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, Semicolon:=True
If ActiveCell.Row = 65536 Then
ActiveWorkbook.Sheets.Add
Else
ActiveCell.Offset(1, 0).Select
End If
Compteur = Compteur + 1
Loop
Close
If ActiveCell.Offset(-1, 2).Value = 8 Then
ActiveCell.Offset(-1, 2).Value = 9
End If
If ActiveCell.Offset(-1, 2).Value = 4 Then
Range(ActiveCell.Offset(-1, 0), ActiveCell.Offset(-1, 4)).Copy
ActiveCell.Insert Shift:=xlShiftDown
Application.CutCopyMode = False
ActiveCell.Offset(0, 2) = 9
ActiveCell.Offset(1).Activate
End If
Next
End If
Application.ScreenUpdating = True
End Sub