Sub Savetxt()
Sheets("Fichier texte").Select
Dim c As Variant
Dim fFilename As String
Dim a As Integer, b As Integer
Dim tmP As String
Dim Separateur As String
Dim derl As Integer
'Tu choisis le séparateur de ton choix
Separateur = vbTab
'Plage à copier
derl = Range("a65536").End(xlUp).Row + 1
With Worksheets("Fichier texte")
c = Range("A1:k" & derl)
End With
Application.DefaultFilePath = Application.DefaultFilePath = "C:\Users\courbois_f\Documents\ECRITURE EXCEL LACTO\lacto siege"
fFilename = _
Application.GetSaveAsFilename(InitialFileName:="R_", _
fileFilter:="Text Files (*.txt), *.txt")
Open fFilename For Output As #1
For a = 1 To UBound(c, 1)
tmP = ""
For b = 1 To UBound(c, 2)
If tmP > "" Then
tmP = tmP & Separateur & c(a, b)
Else
tmP = c(a, b)
End If
Next
Print #1, tmP
Next
Close #1
Erase c
End Sub