Sub test()
With Workbooks.Open(ThisWorkbook.Path & "\FDS.xlsm") 'Ouvre le Fichier Source à voir
FichierTxt .Sheets("30x2"), ThisWorkbook.Path & "\30x2.txt"
FichierTxt .Sheets("35x2"), ThisWorkbook.Path & "\35x2.txt"
.Close
End With
End Sub
Sub FichierTxt(Onglet As Worksheet, Txt As String)
Dim F As Long
F = FreeFile
With Onglet
Enrgt = ""
For Each C In .Range("F7", .Cells(.Rows.Count, "F").End(xlUp))
If Not C.EntireRow.Hidden And CStr(C) <> "" Then
If Enrgt <> "" Then Enrgt = Enrgt & vbCrLf
Enrgt = Enrgt & C.Value
End If
Next C
End With
Open Txt For Append As #F
Print #F, Enrgt
Close #F
End Sub