Wie kann ich das DropDown so befüllen das von der Liste nicht jede Zeile abgefüllt wird sondern jede vorhandene Datum nur einmal.
Ist das verständlich was ich möchte und es das so irgendwie möglich?
=WENNFEHLER(INDEX(K:K;AGGREGAT(15;6;ZEILE(K$2:K$30000)/ISTNV(VERGLEICH(K$2:$K$30000;L$1:L1;)); 1)) &"";"")
With Tabelle1
With Workshets("Daten")
With Worksheets("Daten")
Ansonsten muss du mal -wie von Nepumuk vorgeschlagen- deine Datei abgespeckt/Daten anonymisert mit dem Userform hier hochladen denn die reichweite unberer Kristallkugeln ist begrenzt.
Private Sub UserForm_Initialize()
Dim X As Long, Y As Long, B As Boolean
With ComboBox1
.Clear
For X = 2 To 1000
If Cells(X, 11) "" And Cells(X, 11).RowHeight > 0 Then
For Y = 1 To X - 1
If Cells(Y, 11) = Cells(X, 11) Then
B = True
Exit For
End If
Next Y
If B = False Then
.AddItem Cells(X, 11)
Else
B = False
End If
End If
Next X
End With
End Sub
Das funktioniert perfekt!
Private Sub UserForm_Initialize()
'Private Sub UserForm1_Initialize() '#### Falsch
Dim avntValues As Variant, vntItem As Variant
Dim objDictionary As Object
With Worksheets("Daten")
avntValues = .Range(.Cells(2, 11), .Cells(.Rows.Count, 11).End(xlUp)).Value
End With
Set objDictionary = CreateObject("Scripting.Dictionary")
For Each vntItem In avntValues
objDictionary(vntItem) = vbNullString
Next
ComboBox1.List = objDictionary.Keys
Set objDictionary = Nothing
End Sub