Sub export_txt_6_colonnes()
Dim objShell As Object, objFolder As Object
Dim SecuriteSlash As Integer
Dim Fichier As String, Chemin As String, MaLigne As String
Dim j As Byte
Dim i As Integer, DerniereLigne As Integer
Dim MaCellule As Variant
'******************
'fs
Set objShell = CreateObject('Shell.Application')
Set objFolder = objShell.BrowseForFolder(&H0&, 'Choisir un répertoire', &H1&)
On Error Resume Next
Chemin = objFolder.ParentFolder.ParseName(objFolder.Title).Path
If objFolder.Title = '' Then Chemin = ''
SecuriteSlash = InStr(objFolder.Title, ':')
If SecuriteSlash > 0 Then Chemin = Mid(objFolder.Title, SecuriteSlash - 1, 2) & ''
'*****************
If Chemin = '' Then
MsgBox 'Operation annulée . '
Exit Sub
End If
DerniereLigne = Sheets('mafeuille_mononglet').Range('A65536').End(xlUp).Row
Open Chemin & '\\mon_fichierdexport.txt' For Output As 1
For i = 1 To DerniereLigne
For j = 1 To 6
MaCellule = Cells(i, j).Value
If IsEmpty(MaCellule) = True Then MaCellule = vbNullChar
MaLigne = MaLigne & MaCellule & vbTab
Next j
MaLigne = Left(MaLigne, Len(MaLigne) - 1)
Print #1, MaLigne
MaLigne = ''
Next i
Close 1
End Sub