Option Explicit
Sub Export()
Dim fichier As Variant, F As Worksheet, tablo, i&, txt$
'prefixName = Range("").Value
ChDir ThisWorkbook.Path & "\" 'dossier affiché
'fichier = "Fichier texte" & prefixName & Format(Date, "yyyy-mm-dd")
fichier = "Fichier texte" & Format(Date, "yyyy-mm-dd")
fichier = Application.GetSaveAsFilename(fichier, "Text Files (*.txt), *.txt")
If fichier = False Then Exit Sub
Sheets("1-RF-Profiles").Visible = True
Sheets("1-RF-Profiles").Unprotect "*"
Sheets("2-Aps_Grps").Visible = True
Sheets("2-Aps_Grps").Unprotect "*"
Sheets("3-Flexconnect").Visible = True
Sheets("3-Flexconnect").Unprotect "*"
ActiveSheet.Unprotect "FTS"
For Each F In Sheets(Array("1-RF-Profiles", "2-Aps_Grps", "3-Flexconnect"))
tablo = F.[A1].CurrentRegion.Resize(, 2) 'matrice, plus rapide, au moins 2 éléments
For i = 1 To UBound(tablo)
If Not IsError(tablo(i, 1)) Then If tablo(i, 1) <> "!" Then txt = txt & vbCrLf & tablo(i, 1)
Next i, F
Open fichier For Output As #1
Print #1, Mid(txt, 2)
Sheets("1-RF-Profiles").Visible = False
Sheets("1-RF-Profiles").Protect "*"
Sheets("2-Aps_Grps").Visible = False
Sheets("2-Aps_Grps").Protect "*"
Sheets("3-Flexconnect").Visible = False
Sheets("3-Flexconnect").Protect "*"
Close #1
End Sub