Sub lireFichierTexte()
Dim Ligne As String
Dim Tblo(0 To 7)
Application.ScreenUpdating = False
[COLOR="Red"][B]Open "C:\Users\TonNom\Documents\Excel\import fich.txt"[/B][/COLOR] For Input As #1
Do While Not EOF(1)
Line Input #1, Ligne
If i = 0 Then
Tblo(7) = Trim(Ligne)
ElseIf i = 2 Then
Tblo(1) = Trim(Left(Ligne, InStr(1, Ligne, ":ne") - 1))
ElseIf Left(Ligne, 10) = "Board User" Then
Tblo(0) = "/" & Trim(Right(Ligne, Len(Ligne) - InStr(1, Ligne, ":")))
ElseIf Left(Ligne, 14) = "Board Location" Then
Tblo(2) = Trim(Right(Ligne, Len(Ligne) - InStr(1, Ligne, ":")))
ElseIf Left(Ligne, 10) = "Board Type" Then
Tblo(3) = Trim(Right(Ligne, Len(Ligne) - InStr(1, Ligne, ":")))
ElseIf Left(Ligne, 9) = "Unit Part" Then
Tblo(4) = Left(Trim(Right(Ligne, Len(Ligne) - InStr(1, Ligne, ":"))), 10)
Tblo(5) = Trim(Right(Ligne, 4))
ElseIf Left(Ligne, 6) = "Serial" Then
Tblo(6) = Trim(Right(Ligne, Len(Ligne) - InStr(1, Ligne, ":")))
[A65000].End(xlUp)(2) = Join(Tblo, ";")
End If
i = i + 1
Loop
Close #1
Columns("A").AutoFit
End Sub