Rebonjour,
J'ai juste une petite question ...
J'aimerais incorporer un argument dans la macro au niveau du Like en lui demandant si les données correspondent à "CEX - Chargement" OU "CT - Chargement".
Cependant l'argument "Or" ne fonctionne pas dans ce cas là.
Avez-vous des pistes ?
Sub EXPE()
Dim tb(), t
Dim i, j, n, k
Dim val$, mot$
With Range("TB_extraction")
For i = 1 To .Rows.Count
If .Cells(i, 16) Like "CEX - Chargement" Then ''''''''''''''''''''''''''''' A ce niveau là '''''''''''''''''''''''''''''''
If .Cells(i, 4).Value Like "*" & "/" & "*" Then
val = Mid(.Cells(i, 4).Value, 7): mot = Left(.Cells(i, 4), 7)
t = Split(val, "/")
For j = LBound(t) To UBound(t)
n = n + 1: ReDim Preserve tb(1 To 5, 1 To n)
tb(1, n) = mot & Format(Application.Trim(Application.Clean(t(j))), "00000")
tb(2, n) = .Cells(i, 3).Value
tb(3, n) = .Cells(i, 16).Value
tb(4, n) = .Cells(i, 1).Value
tb(5, n) = .Cells(i, 14).Value
Next j
Else
n = n + 1: ReDim Preserve tb(1 To .Columns.Count, 1 To n)
tb(1, n) = .Cells(i, 4).Value
tb(2, n) = .Cells(i, 3).Value
tb(3, n) = .Cells(i, 16).Value
tb(4, n) = .Cells(i, 1).Value
tb(5, n) = .Cells(i, 14).Value
End If
End If
Next i
With Range("TB_expe")
On Error Resume Next
.Delete
.Resize(n, .Columns.Count).Value = Application.Transpose(tb)
.Range("TB_expe[RDV]").NumberFormat = "h:mm;@"
.Range("TB_expe[Date]").NumberFormat = "m/d/yyyy"
End With
End With
End Sub
Merci d'avance,
L'EDM