bonjour,
pour modifier le/les caractères de fin de ligne, tu peux faire cela via Notepad++, il y a une option de gestion de la fin de ligne.
tu peux aussi utiliser les possibilités offertes en standard par excel (import fichier texte, powerquery, ...)
sinon une proposition de modification de ton code pour gérer des fichiers avec CRLF ou LF
Private Sub lecture(fichier As String)
Dim depart As Integer, position As Integer
Dim texte As String, tampon As String, lignefichier as String, tabtexte
Open fichier For Input As #1
Do While Not EOF(1)
Line Input #1, lignefichier
tabtexte = Split(lignefichier, vbLf)
For i = LBound(tabtexte) To UBound(tabtexte)
texte = tabtexte(i)
depart = 1: position = 1
Do While (position <> 0)
position = InStr(depart, texte, ";", 1)
If position = 0 Then
tampon = Mid(texte, depart)
Sheets("Import").Cells(ligne_enCours, colonne_enCours).Value = tampon
Exit Do
Else
tampon = Mid(texte, depart, position - depart)
End If
Sheets("Import").Cells(ligne_enCours, colonne_enCours).Value = tampon
depart = position + 1
colonne_enCours = colonne_enCours + 1
Loop
colonne_enCours = colonne_debut
ligne_enCours = ligne_enCours + 1
Next i
Loop
Close #1
End Sub