Sub deplacer()
Application.ScreenUpdating = False
Call Création
Windows("TEST.xlsx").Activate
Dim sh As Worksheet
For Each sh In Worksheets
If sh.Name <> "GLOBAL" Then
sh.Move After:=Workbooks("Transfert.xlsx").Sheets(3)
Windows("TEST.xlsx").Activate
End If
Next
MsgBox "Les feuilles ont été transferées vers le classeur c:\Transfert.xlsx", vbInformation, "Transfert!!"
Application.ScreenUpdating = True
End Sub
Sub Création()
Workbooks.Add
ChDir "C:\"
ActiveWorkbook.SaveAs Filename:="C:\Transfert.xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
'ouvre le classeur 'Transfert.xlsx
Set Wb = Workbooks.Open("C:\Transfert.xlsx")
Application.ScreenUpdating = True
End Sub