Sub exporter()
Dim i As Long, j As Long, nl As Long, nc As Long
Dim pathFichierTxt As String
Dim sText As String
pathFichierTxt = Sheets("donnees_sorties").Range("D3").Text 'chemin d'accès du fichier
nl = Sheets("information_enregistrement").Range("E5") 'nombre de ligne à copier
nc = Sheets("information_enregistrement").Range("E6") 'nombre de colonne à copier
Open pathFichierTxt For Output As #1
Print #1, "teste"
For i = 5 To nl + 5
sText = ""
For j = 1 To nc
sText = sText & Cells(i, j) & vbTab
Next j
sText = Mid(sText, 1, Len(sText) - 1)
Print #1, sText
Next i
Close #1
End Sub