1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Dim wbk1 As Workbook, wbk2 As Workbook
Dim Stock As Range, c As Range
Dim LastLig As Long, i As Long
Application.ScreenUpdating = False
Set wbk1 = Workbooks("tableau.xls")
Set wbk2 = ThisWorkbook
With wbk1.Sheets("Feuil1") 'à adapter
LastLig = .Cells(Rows.Count, 1).End(xlUp).Row
Set Stock = .Range("A7:B" & LastLig)
End With
With wbk2.Sheets("Feuil2") 'à adapter
LastLig = .Cells(Rows.Count, 1).End(xlUp).Row
For i = 7 To LastLig
Set c = Stock.Columns(1).Find(.Range("A" & i).Value, LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then
.Range("D" & i).Value = c.Offset(0, 1).Value
End If
Next i
End With
Set wbk1 = Nothing
Set wbk2 = Nothing |