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
| Sub test()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
With Sheets("Feuil1")
.Columns("A:B").Copy .Range("C1")
.Range("C2:C" & .Range("C" & Rows.Count).End(xlUp).Row).Replace What:="h", Replacement:="|", LookAt:=xlPart
.Range("C2:C" & .Range("C" & Rows.Count).End(xlUp).Row).Replace What:="min", Replacement:="|", LookAt:=xlPart
.Range("C2:C" & .Range("C" & Rows.Count).End(xlUp).Row).Replace What:="sec", Replacement:="|", LookAt:=xlPart
.Range("D2:D" & .Range("D" & Rows.Count).End(xlUp).Row).Replace What:="h", Replacement:="|", LookAt:=xlPart
.Range("D2:D" & .Range("D" & Rows.Count).End(xlUp).Row).Replace What:="min", Replacement:="|", LookAt:=xlPart
.Range("D2:D" & .Range("D" & Rows.Count).End(xlUp).Row).Replace What:="sec", Replacement:="|", LookAt:=xlPart
For L = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
.Cells(L, 3).TextToColumns Destination:=Range("E" & L), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="|", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), _
TrailingMinusNumbers:=True
.Cells(L, 4).TextToColumns Destination:=Range("H" & L), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="|", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), _
TrailingMinusNumbers:=True
.Cells(L, "K") = .Cells(L, "H") - .Cells(L, "E")
.Cells(L, "L") = .Cells(L, "I") - .Cells(L, "F")
.Cells(L, "M") = .Cells(L, "J") - .Cells(L, "G")
Next L
End With
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub |
Partager