Private Sub Worksheet_change(ByVal Target As Range)
Dim P As Range, t, ub%, i&, j%, chemin$
Set P = [A1].CurrentRegion 'à adapter
t = P.Resize(P.Rows.Count + 1) 'tableau, plus rapide, au moins 2 éléments
ub = UBound(t, 2)
For i = 1 To UBound(t) - 1
For j = 1 To ub
t(i, j) = IIf(IsDate(t(i, j)), Format(t(i, j), "dd-mm-yyyy"), P(i, j).Text) 'on met ce qu'on veut
Next j, i
t(1, 1) = "TEXTE"
'---restitution dans un fichier Texte---
chemin = ThisWorkbook.Path & "\Fichier Texte.txt" 'à adapter
Application.ScreenUpdating = False
With Workbooks.Open(chemin).Sheets(1)
.Cells.Clear
With .[A1].Resize(P.Rows.Count, ub)
.NumberFormat = "@" 'format Texte
.Value = t
End With
.Parent.Close True
End With
End Sub