Bonjour,
J'essaie de réaliser une exportation d'une sélection d'une de mes 5 feuilles excel mais mon code ne fonctionne pas...
Sub export_txt()
Dim wb As Workbook
Dim ws As Worksheet
Dim newWB As Workbook
Dim newWS As Worksheet
Dim Nom_Sauvegarde As String
Application.ScreenUpdating = False
Set wb = ActiveWorkbook
Set ws = ActiveSheet
Range("$A$1:$R$20").Select
With Selection
.Copy
End With
Set newWB = ActiveWorkbook
Nom_Sauvegarde = InputBox("Entrer le nouveau nom de fichier :")
With newWB
.SaveAs Nom_Sauvegarde, xlText
.Close (False)
End With
wb.Activate
exitSave:
Application.ScreenUpdating = True
Exit Sub
End Sub
Voici ce que j'ai fait.