1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| Sub Archivage()
Dim Wb1 As Workbook
Dim WB2 As Workbook
Dim Plg As Range, Derlgin As Long
Application.ScreenUpdating = False
Set Wb1 = ThisWorkbook
Set WB2 = Workbooks.Open("C:\Users\.......\Documents\..........\Facture_Archive")
Set Plg = Wb1.Sheets("Empl").Range("A8:J" & Wb1.Sheets("Empl").Range("A65536").End(xlUp).Row)
With WB2.Sheets("Archive_Facture")
derlign = .Range("A65536").End(xlUp).Row
Plg.Copy .Range("A" & derlign + 1)
.Columns("A:J").AutoFit
End With
WB2.Save
WB2.Close
Application.ScreenUpdating = True
End Sub |
Partager