1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
|
Sub test()
Dim dico As Object, i&, elem, lig
Set dico = CreateObject("scripting.dictionary")
With Sheets("X_Attlog - Copie")
For i = 1 To .Cells(Rows.Count, 1).End(xlUp).Row
dico(.Cells(i, 1).Text & "|" & .Cells(i, 2).Text) = dico(.Cells(i, 1) & "|" & .Cells(i, 2)) & "|" & TimeValue(.Cells(i, 3).Text)
Next
End With
lig = 4 'tu commence en ligne 4 dans ton exemple
With Sheets(2)
.Cells.Clear
For Each elem In dico: .Cells(lig, 1) = elem & "|" & dico(elem): lig = lig + 1: Next
.Columns("A:A").TextToColumns Destination:=.Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=True, Other:=True, OtherChar:="|", TrailingMinusNumbers:=True
End With
End Sub |
Partager