bonjour
J'ai besoin d'aide pour mon macro archivage. Actuellement, le macro fonctionne pour une feuille spécifique, je voudrais archiver feuille active.
voici mon macro qui marche seulement pour la feuille Empl.
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
merci pour votre aide
J'ai besoin d'aide pour mon macro archivage. Actuellement, le macro fonctionne pour une feuille spécifique, je voudrais archiver feuille active.
voici mon macro qui marche seulement pour la feuille Empl.
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
merci pour votre aide