Sub Auto_open()
Dim ligne As Integer
Dim stFichier As String
Dim wk As Workbook 'classeur destination
Dim wS As Workbook 'classeur source
Set wS = ThisWorkbook
chemin = ActiveWorkbook.Path
ReDim op(300)
For ligne = 1 To 300
op(ligne) = Cells(ligne, 2).Value
Next ligne
stFichier = Dir(chemin & "\source*.xls") 'test si il y a un fichier source... .xls
If stFichier <> "" Then
Set wk = Workbooks.Open(chemin & "\" & stFichier)
For i = 1 To 300
For j = 1 To 300
If wk.Cells(i, 2).Value = op(j) Then
wk.Cells(j, 3).Value = wS.Cells(i, 5).Value
wk.Cells(j, 4).Value = wS.Cells(i, 4).Value
wk.Cells(j, 5).Value = wS.Cells(i, 6).Value
wk.Cells(j, 6).Value = wS.Cells(i, 7).Value
wk.Cells(j, 7).Value = wS.Cells(i, 8).Value
wk.Cells(j, 8).Value = wS.Cells(i, 9).Value
End If
Next j
Next i
Else
MsgBox "Erreur aucun fichier trouvé.."
End If
End Sub