1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
Sub exp()
Dim Fe As Worksheet
Dim Plage As Range
Dim Tbl()
Dim X As Integer
Dim Ligne As Integer
Set Fe = Workbooks("wk48production").Worksheets("Packing Production Schedule")
Set Plage = Workbooks("vba stock Final version").Worksheets("feuil1").Range("A9:K102")
Ligne = Fe.Cells(Rows.Count, 5).End(xlUp).Row
ReDim Tbl(1 To Ligne)
With Application.WorksheetFunction
For X = 1 To Ligne
Tbl(X) = .IfError(.VLookup(CStr(Fe.Cells(X, 7).Value), Plage, 7, False), "")
'Fe.Cells(X, 5).Value = .IfError(.VLookup(CStr(Fe.Cells(X, 7).Value), Plage, 7, False), "")
Next X
Fe.Range(Fe.Cells(1, 5), Fe.Cells(Ligne, 5)).Value = .Transpose(Tbl)
End With
End Sub |
Partager