Bonjour @Banzai64,
J'essaye d'utiliser le code d'extraction de donnees que vous avez ecris pour d'autre fichiers.
Or je n'arrive pas a l'adapter...
Pouvez vous svp indiquer quelques commentaires sur le code suivant, m'indiquant quelle fonction fait quoi de sorte a ce que je puisse l'adapter et le reutiliser.
Merci bcp pour votre aide.
cdlt
Option Explicit
Sub Macro1() 'plusieurs onglets sources et differents classeurs
Dim Path As String, Folder As String
Dim cel As Range
Dim WsSource As Worksheet, WsDestin As Worksheet
Dim Feuilles, NbColonnes
Dim J As Long
Dim I As Integer, Colonne As Integer
Application.ScreenUpdating = False
Path = "P:\xxxxxxx\ 2013_2014 KPI Reporting\" 'key here the path
Folder = "Year 2013-2014.xlsx" 'key here the folder
If Dir(Path & Folder) = "" Then
MsgBox "Can't find the folder in " & Path
Exit Sub
End If
Feuilles = Array("Jan ExpRpt PVT", "Jan Rejection PVT", _
"Feb ExpRpt PVT", "Feb Rejection PVT", _
"Mar ExpRpt PVT", "Mar Rejection PVT")
NbColonnes = Array(3, 1, 3, 1, 3, 1)
Set WsDestin = Sheets("AR DATA")
Colonne = 2
With Workbooks.Open(Path & Folder)
For I = 0 To UBound(Feuilles)
For J = 3 To WsDestin.Range("A" & Rows.Count).End(xlUp).Row
Set cel = .Sheets(Feuilles(I)).Columns("A").Find(what:=WsDestin.Range("A" & J), LookIn:=xlValues, lookat:=xlWhole)
If Not cel Is Nothing Then
cel.Offset(0, 1).Resize(1, NbColonnes(I)).Copy WsDestin.Cells(J, Colonne)
End If
Next J
Colonne = Colonne + NbColonnes(I)
Next I
.Close savechanges:=False
End With
Application.ScreenUpdating = True
End Sub