ich lese per Schleife einige Werte aus einer Tabelle in ein Kombinationsfeld ein.
Ich möchte diese Werte aber vor dem einlesen sortieren.
Wie kann ich dies machen ohne die Tabelle zu sortieren?
Danke Euch schonmal.
VG
Steffen
Sub arryay_füllen_sortieren_u_in_Combobox_schreiben()
Dim objColl As New Collection
Dim ws As Worksheet
Set ws = ActiveSheet
For i = 3 To 15
objColl.Add ws.Cells(i , 2)
Next
For lngZ = 0 To objColl.Count - 1
For lngC = 1 To lngZ
If objColl(lngC) > objColl(lngZ) Then
strTemp = objColl(lngZ)
objColl(lngZ) = objColl(lngC)
objColl(lngC) = strTemp
End If
Next
Next
For i = 1 To objColl.Count - 1
me.combobox1.additem objColl(i + 1)
Next
End Sub