Sub Enrg_Sous()
Dim WbSource, WbDest As Workbook, chemin As String
Application.ScreenUpdating = False
Set WbSource = Workbooks("Tableau.xls")
chemin = "C:\Users\" & Environ("username") & "\Desktop\Macro Test\"
With WbSource
.Sheets("Data").Range("a1:i37").AutoFilter Field:=1, Criteria1:=ActiveCell, Operator:=xlAnd
.Sheets("Data").Range("a2:i37").SpecialCells(xlCellTypeVisible).Copy .Sheets("Report").Range("a65536").End(xlUp)(2)
.Sheets("Report").Range("A:I").Columns.AutoFit
.Sheets("Report").Activate
ActiveSheet.Copy
nom = ActiveSheet.Range("a2")
ActiveSheet.SaveAs Filename:=chemin & nom & ".xls", FileFormat:=xlExcel8
End With
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.Quit
End Sub
Sub Copier_Suite()
Dim WbDest As Workbook, chemin As String, nom As String
Application.ScreenUpdating = False
chemin = "C:\Users\" & Environ("username") & "\Desktop\Macro Test\"
nom = ActiveCell.Value & ".xls"
With Sheets("Data")
.Range("a1:i37").AutoFilter Field:=1, Criteria1:=ActiveCell, Operator:=xlAnd
Set WbDest = Workbooks.Open(chemin & nom)
.Range("a2:i37").SpecialCells(xlCellTypeVisible).Copy WbDest.Sheets("Report").Range("a65536").End(xlUp)(2)
End With
Application.DisplayAlerts = False
ActiveWorkbook.Save
Application.Quit
End Sub