folgender Code füllt eine ComboBox mit Werten.
Private Sub UserForm_Initialize()
Dim ixCol As Integer
Dim ixRow As Long
Dim ixRowS As Long
Dim ixRowE As Long
Dim ixList As Integer
ixList = 0
ixCol = 30 ' Suchspalte (H = 8)
ixRowS = 2 ' ab Starreihe
ixRowE = 1000 ' bis Schlussreihe
ComboBox1.Clear
ComboBox1.SetFocus
ComboBox1.AddItem ActiveSheet.Cells(ixRowS, ixCol).Value
For ixRow = ixRowS + 1 To ixRowE
If Not IsEmpty(ActiveSheet.Cells(ixRow, ixCol).Value) Then
For ixList = 0 To ComboBox1.ListCount - 1
If UCase(ComboBox1.List(ixList)) > UCase(ActiveSheet.Cells(ixRow, ixCol).Value) _
Then
ComboBox1.AddItem ActiveSheet.Cells(ixRow, ixCol).Value, ixList
Exit For
End If
Next ixList
If ixList = ComboBox1.ListCount Then
If UCase(ComboBox1.List(ixList - 1))
Diese Werte sollen aufsteigend angezeigt werden. Leider sieht die Reihenfolge aber so aus1
101
11
2
22
240
25
3
31
32
usw.
Wie muss der Code geändert werden, damit es wirklich aufsteigend angezeigt wird? Wäre für Hilfe sehr dankbar!
Gruß Bernd