Sub IntegrerW()
'
' IntegrerW Macro
'
'
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim vCible As Worksheet, vSource As Workbook, DLigC As Long, LigS As Long
Set vCible = ActiveSheet
Set vSource = Workbooks.Open(ThisWorkbook.Path & "\Demandes.xlsx")
With vSource.Worksheets("Données")
DLigC = .Range("A" & Rows.Count).End(xlUp).Row 'dernière ligne Source
LigS = vCible.Range("A" & Rows.Count).End(xlUp).Row + 1 '1ére ligne utile Cible
.Range("A2:K" & DLigC).Copy vCible.Range("A" & LigS) 'copy de Source à Cible
End With
vSource.Close
Set vSource = Workbooks.Open(ThisWorkbook.Path & "\Demandes_Z.xlsx")
With vSource.Worksheets("Données")
DLigC = .Range("A" & Rows.Count).End(xlUp).Row 'dernière ligne Source
LigS = vCible.Range("A" & Rows.Count).End(xlUp).Row + 1 '1ére ligne utile Cible
.Range("A2:K" & DLigC).Copy vCible.Range("A" & LigS) 'copy de Source à Cible
End With
vSource.Close
MsgBox "Le rapatriement des données 1 & 2 à réussi!", vbInformation, "Info!"
End Sub