1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub exp()
Dim ws As Worksheet
Set ws = Workbooks("wk49production").Sheets("Packing Production Schedule")
Set rng = Workbooks("deliveries macro").Worksheets("feuil1").Range("A13:C105")
For x = 1 To 1000
For y = 13 To 150
On Error Resume Next
If Workbooks("deliveries macro").Worksheets("feuil1").Cells(y, 3) <> "" Then
ws.Cells(x, 5) = Left(ws.Cells(x, 5), 5) & "+" & "[" & Application.VLookup(ws.Cells(x, 7), rng, 3, False) & "]" & _
"on " & Application.VLookup(Workbooks("deliveries macro").Worksheets("feuil1").Cells(10, 3), Range("C10:J10"), 1, False)
On Error Resume Next
End If
Next y
Next x
End Sub |