1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Option Explicit
Dim t As Variant, t2() As String, c As Range, x As Long, i As Long, j As Long, k As Long
Sub es()
On Error Resume Next
Application.ScreenUpdating = False
For Each c In Sheets("carte des délais").[d24hr]
With Sheets("globale")
t = .Range("d6:q" & .Range("d65536").End(xlUp).Row)
x = 1
For i = 1 To UBound(t)
If t(i, 5) = c And t(i, 9) = "DHL3" Then
ReDim Preserve t2(1 To 14, 1 To x)
For k = 1 To 14
t2(k, x) = t(i, k)
Next k
x = x + 1
End If
Next i
Sheets("dhl24").Range("a65536").End(xlUp)(2).Resize(UBound(t2, 2), UBound(t2, 1)) = Application.Transpose(t2)
Erase t, t2
End With
Next c
End Sub |
Partager