Sub SauvegarderTexte()
Dim chemin$, w As Worksheet, F%, MonFichier$, xDerlig&, xcell As Range
chemin = ThisWorkbook.Path & "\" 'dossier à adapter
For Each w In Worksheets
F = FreeFile
MonFichier = chemin & w.Name & ".txt"
xDerlig = w.Range("B" & w.Rows.Count).End(xlUp).Row
Open MonFichier For Output As #F
Print #F, "EPANET Pattern Data"
Print #F, "Courbe de modulation de " & w.Name
For Each xcell In w.Range("B3:B" & xDerlig)
Print #F, Format(xcell.Value, "0.00")
Next xcell
Close #F
Next w
End Sub