Bonsoir le forum,
Le code testé sur 40 lignes fonctionne sans encombre, mais rame sans fin avec 1700 lignes
Quelqu'un pourrait-il m'indiquer une bonne façon d'alimenter cette ListBox triée alphabétiquement :
	
	
	
	
	
		
Par avance, merci !
	
		
			
		
		
	
				
			Le code testé sur 40 lignes fonctionne sans encombre, mais rame sans fin avec 1700 lignes
Quelqu'un pourrait-il m'indiquer une bonne façon d'alimenter cette ListBox triée alphabétiquement :
		VB:
	
	
	Private Sub UserForm_Initialize()
Dim wsBD As Worksheet, lastCell As Integer, lastRow As Integer, x As Integer
Dim i As Long, j As Long, Temp As Variant
Set wsBD = ThisWorkbook.Sheets("BD")
lastRow = wsBD.Range("A" & Rows.Count).End(xlUp).Row
For x = 1 To lastRow
    Me.ListBox1.AddItem wsBD.Cells(x, wsBD.Cells(x, Columns.Count).End(xlToLeft).Column).Value
Next x
With ListBox1
    For i = 0 To .ListCount - 2
        For j = i + 1 To .ListCount - 1
            If .List(i) > .List(j) Then
                Temp = .List(j)
                .List(j) = .List(i)
                .List(i) = Temp
            End If
        Next j
    Next i
End With
End Sub
	Par avance, merci !
Pièces jointes
			
				Dernière édition: