ich habe ein Macro mit dem ich eine combobox
mit einen array befüllen lasse. Hier nun das Macro:
Private Sub ComboBox_fuellen()
Dim dic As Object
Dim xKey As Variant
Dim iRow As Long, ALetzte As Long
Dim Letzter As Integer, Naechster As Integer
Dim i As String
Application.ScreenUpdating = False
Worksheets("Simpati-Daten").Activate
ALetzte = IIf(IsEmpty(Range("A65536")), Range("A65536").End(xlUp).Row, 65536)
Set dic = CreateObject("scripting.dictionary")
ComboBox1.AddItem ""
For iRow = 3 To ALetzte
If Not IsEmpty(Cells(iRow, 4)) Then
xKey = Cells(iRow, 4).value
dic(xKey) = 0
End If
Next
For Each xKey In dic
ComboBox1.AddItem xKey
Next
dic.RemoveAll
Set dic = Nothing
'Call Sortieren
With ComboBox1
For Letzter = 0 To .ListCount - 1
For Naechster = Letzter + 1 To .ListCount - 1
If .List(Letzter) > .List(Naechster) Then
i = .List(Letzter)
.List(Letzter) = .List(Naechster)
.List(Naechster) = i
End If
Next Naechster
Next Letzter
End With
ComboBox1.ListIndex = 0
Application.ScreenUpdating = True
End Sub
Nun habe ich bis zu 18 Comboxen die eigentlich alle
mit den selbigen Items gefüllt werden soll, komme aber hier nicht weiter.
Kann mir jemand einen kleine Ansatz geben?
Gruß Jörg