kann mir bitte jemand bei folgendem Problem helfen?
Ich habe in einer Userform eine ComboBox erstellt und möchte aus einer Spalte eines Sheets eine Dropdownliste auswählen. Doppelte Werte und "0" sollen allerdings nicht angezeigt werden. Bei dem unten geschriebenen Auszug wird immer nur der erste Wert angezeigt und nicht die komplette Liste.
Hier geht es mir um die Combo Box 4.
Ein weiteres Problem ist, dass die Auswahl in Combo Box 4 von Combobox 1 abhängt. Allerdings erfolgt die Auswahl von 4 schon beim öffnen und nicht erst nach der Auswahl von 1. Kann man hier eine Abhängigkeit programmieren, so dass die Auswahl von vier erst nach der Auswahl von 1 erfolgt?
Vielen DAnk. Wäre super wenn mir jemand helfen könnte.
Gruß
Nils
Private Sub UserForm_Initialize()
Dim Projekt As String
Dim vnt As Variant
Dim D As Object
Dim i As Integer
ComboBox1.List = Range("B6:B30").Value
ComboBox1.ListIndex = 0
ComboBox2.AddItem "A"
ComboBox2.AddItem "B"
ComboBox2.AddItem "C"
ComboBox2.ListIndex = 0
ComboBox3.AddItem "JK"
ComboBox3.AddItem "NB"
ComboBox3.AddItem "SB"
ComboBox3.AddItem "UK"
ComboBox3.AddItem "MH"
ComboBox3.ListIndex = 0
Projekt = ComboBox1
ThisWorkbook.Sheets(Projekt).Select
vnt = Range("E2:E9999").Value
Set D = CreateObject("scripting.dictionary")
For i = 1 To UBound(vnt, 2)
On Error Resume Next
If Len(vnt(1, i)) > 0 Then D.Add vnt(1, i), 0
On Error GoTo 0
Next
ComboBox4.List = D.keys
Set D = Nothing
End Sub