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 31 32 33 34 35 36 37 38 39 40
| Sub tri()
Dim Derlig As Long
Dim Plage As Range, C As Range
Dim i As Long
Dim F As Worksheet
Dim Tableau() As String
Derlig = Range("A65536").End(xlUp).Row
Set F = Worksheets(2)
Set Plage = Range("A1", "A" & Derlig)
i = 1
For Each C In Plage
If C.Value = "^" Then i = i + 1
If Left(C.Value, 1) = "D" Then F.Cells(i, 1).Value = Right(C.Value, 10)
If Left(C.Value, 1) = "L" Then
C.Value = Replace(C.Value, "L", "")
Tableau = Split(C.Value, ":")
On Error Resume Next
F.Cells(i, 2).Value = Tableau(1)
F.Cells(i, 3).Value = Tableau(2)
End If
If Left(C.Value, 1) = "M" Then F.Cells(i, 4).Value = Right(C.Value, Len(C.Value) - 1)
If Left(C.Value, 1) = "T" Then
If Mid(C.Value, 2, 1) = "-" Then
F.Cells(i, 6).Value = Right(C.Value, Len(C.Value) - 2)
Else
F.Cells(i, 5).Value = Right(C.Value, Len(C.Value) - 1)
End If
End If
If Left(C.Value, 1) = "C" And Mid(C.Value, 2, 1) = "*" Then F.Cells(i, 7).Value = "Validé"
Next C
End Sub |
Partager