Private Sub CommandButton1_Click()
Dim plage As Range, a, i&
Dim Colonnes
Colonnes = Array(1, 3, 4, 5, 6, 7, 8) 'colonnes à afficher
Set plage = Range("A3:H" & Cells(Cells.Rows.Count, "B").End(xlUp).Row)
With UserForm1.ListBox1
.ColumnCount = UBound(Colonnes) + 1
.List = Application.Index(Range("A2:H2"), [Row(1:2)], Colonnes)
End With
With UserForm1.ListBox2
.ColumnCount = UBound(Colonnes) + 1
a = plage
For i = 1 To UBound(a)
a(i, 6) = Format(a(i, 6), "hh:mm")
Next i
.List = Application.Index(a, Evaluate("Row(1:" & plage.Rows.Count & ") "), Colonnes)
If plage.Row = 2 Then .Clear Else .TopIndex = .ListCount
End With
With UserForm1.ListBox3: .Clear: .AddItem [B1]: End With
With Sheets("STATS").[H2:Q31]
Application.ScreenUpdating = False: .Parent.Activate: Me.Activate: Application.ScreenUpdating = True 'exécute le tri
UserForm1.ListBox4.ColumnCount = .Columns.Count
UserForm1.ListBox4.ColumnWidths = Application.Rept((UserForm1.ListBox4.Width - 10) \ .Columns.Count & ";", .Columns.Count)
If Application.Count(.Columns(1)) Then UserForm1.ListBox4.List = .Resize(Application.Count(.Columns(1))).Value
End With
With UserForm1.ListBox5: .Clear: .AddItem Sheets("STATS").[L1]: End With
UserForm1.Show 0 'ouverture en non modal
End Sub