Sauvegarder txt en Excel
k
Bonjour,
j'ai ma macro qui ouvre et transforme mon fichier texte en classeur excel. Maintenant j'aimerais sauvegarder le résultat en fichier Excel automatiquement.
Private Sub CommandButton1_Click()
Dim txtchemin As Variant
txtchemin = Application.GetOpenFilename(filefilter:="Fichiers text (*.txt), *.txt*", Title:="Ouverture du fichier Text")
If txtchemin = False Then
MsgBox "Aucun fichier Choisi! Veuillez réessayer", vbCritical, "ERROR DE CHOIX"
End
End If
Workbooks.OpenText Filename:=txtchemin, Origin:=xlMSDOS, StartRow:=2, DataType:=xlFixedWidth, FieldInfo:= _
Array(Array(0, 1), Array(13, 1), Array(14, 1), Array(16, 1), Array(17, 1), Array(19, 1), _
Array(27, 1), Array(39, 1), Array(43, 1), Array(69, 1), Array(79, 1), Array(88, 1), Array( _
96, 1), Array(104, 1), Array(116, 1), Array(182, 1), Array(193, 1), Array(259, 1), Array( _
274, 1), Array(287, 1), Array(321, 1), Array(353, 1), Array(385, 1), Array(390, 1), Array(417, 1), Array( _
420, 1)), TrailingMinusNumbers:=True
End SubMerci d'avance.