Bonjour,
Adapter le format désiré au besoin ...
Ajouter une condition pour la colonne 6 ...
Sub TriRésultat()
Set f2 = Sheets("résultat")
Set Rng = f2.Range("A2:M" & f2.[A65000].End(xlUp).Row)
Rng.Sort key1:=f2.[B2], Order1:=xlAscending, _
key2:=f2.[E2], Order2:=xlAscending, Header:=xlNo
a = Rng.Value
ligne = 2
f2.Cells.ClearContents
For i = LBound(a) To UBound(a)
For c = 1 To NbCol
If c = 6 Then ' ajout de condition > si colonne 6
f2.Cells(ligne, c).NumberFormat = "h:mm:ss AM/PM" ' < place le format
f2.Cells(ligne, c) = a(i, c) ' écrire la donnée
Else
f2.Cells(ligne, c) = a(i, c) ' si pas colonne 6
End If
Next c
ligne = ligne + 1
If i < UBound(a) Then
If a(i, 2) <> a(i + 1, 2) Or a(i, 5) <> a(i + 1, 5) Then ligne = ligne + 1
End If
Next i
col = 0
For Each c In ColVisu
col = col + 1
f2.Cells(1, col) = [Tableau1].Offset(-1).Item(1, c)
Next c
f2.Cells.EntireColumn.AutoFit
End Sub
ric