ich habe einen Fehler im Quicksort, aber ich weiß nicht wo. Ich erhalte keine Fehlermeldung. Meine ComboBox wird gefüllt, die doppelten Datensätze elemeniert, aber nicht sortiert. Kann mir bitte jemand helfen. Der Quicksort ist nicht von mir. Ich habe es wie viele im Netz gefunden und versucht meinen Anforderungen anzupassen.
'
Const C_mstrDatenblatt As String = "Raw Data"
Dim mobjDic As Object
Dim mlngLast As Long
Dim mlngZ As Long
Dim loLetzte As Long
Private Sub Product_Change()
Dim mobjDic As Object
Dim mlngZ As Long
Set mobjDic = CreateObject("Scripting.Dictionary")
With Worksheets(C_mstrDatenblatt)
For mlngZ = 8 To mlngLast
If .Cells(mlngZ, 2).Value = Product.Value
Next
End With
Set mobjDic = Nothing
End Sub
Private Sub UserForm_Activate()
' Doppelte elemenieren
Dim mobjDic As Object
Dim mlngZ As Long
Set mobjDic = CreateObject("Scripting.Dictionary")
With Worksheets(C_mstrDatenblatt)
For mlngZ = 8 To mlngLast
If Not IsEmpty(.Cells(mlngZ, 2).Value) Then mobjDic(.Cells(mlngZ, 2).Value) = 0
Next
End With
Product.List = mobjDic.keys
Call QickSort(0, Product.ListCount - 2, Product)
Set mobjDic = Nothing
End Sub
Private Sub QickSort(ByVal pvlngLBorder1 As Long, ByVal pvlngUBorder1 As Long, ByRef _
probjCombobox As MSForms.ComboBox)
'Die QickSort Funktion sortiert die Anlagenkürzel alphabetisch.
Dim ialngIndex1 As Long, ialngIndex2 As Long
Dim strBuffer1 As String, strTemp1 As String
ialngIndex1 = pvlngLBorder1
ialngIndex2 = pvlngUBorder1
With probjCombobox
strTemp1 = .List((ialngIndex1 + ialngIndex2) \ 2, 0)
Do
Do While .List(ialngIndex1, 0) ialngIndex2
End With
If pvlngLBorder1