online 1
gast (50)

/ Forum / Tabellenkalkulation

TabellenkalkulationTabellenkalkulation

Fragevon fedjo vom 02.06.2020, 17:36 Options

ComboBox Datum Sortieren

Hallo Excelexperten,
brauche mal wieder eure Hilfe zur einer ComboBox (UserForm).
Ich habe einen Code gefunden der Zahlen (Text) in der ComboBox sortiert, gibt es eine Möglichkeit auch Datum zu sortieren?

Ich hoffe ihr habt eine Idee dazu.

Gruß
fedjo

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 = 6 ' Column of ListRange (e.g. F = 6)
ixRowS = 9 ' RowStart of ListRange
ixRowE = 514 ' RowEnd of ListRange

ComboBox2.Clear
ComboBox2.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 ComboBox2.ListCount - 1
If UCase(ComboBox2.List(ixList)) = UCase(ActiveSheet.Cells(ixRow, ixCol).Value) Then Exit For
If UCase(ComboBox2.List(ixList)) > UCase(ActiveSheet.Cells(ixRow, ixCol).Value) Then
ComboBox2.AddItem ActiveSheet.Cells(ixRow, ixCol).Value, ixList
Exit For
End If
Next ixList
If ixList = ComboBox2.ListCount Then
If UCase(ComboBox2.List(ixList - 1)) < UCase(ActiveSheet.Cells(ixRow, ixCol).Value) Then ComboBox2.AddItem ActiveSheet.Cells(ixRow, ixCol).Value
End If
End If
Next ixRow
End Sub


Antwort schreiben

Ähnliche Themen

Combobox in Excel mit Daten aus Tabellenblatt füllen. Ohne Dubletten!
40Rainer  16.06.2007 - 413 Hits - 7 Antworten

Tabelle nach 2 Kriterien sortieren
morpheus__85  20.09.2007 - 24 Hits - 4 Antworten

Suchergebnisse v Google nach Datum sortieren lassen ?
nowerman  02.01.2008 - 56 Hits - 2 Antworten

UserForm ComboBox
fedjo  20.05.2008 - 190 Hits - 3 Antworten

Hinweis

Diese Frage ist schon etwas älter, Sie können daher nicht mehr auf sie antworten. Sollte Ihre Frage noch nicht gelöst sein, stellen Sie einfach eine neue Frage im Forum..

Neue Einträge

Version: supportware 1.9.150 / 10.06.2022, Startzeit:Mon Jan 26 01:23:17 2026