Live-Forum - Die aktuellen Beiträge
Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender

Forumthread: Userform zum Sortieren

Userform zum Sortieren
23.09.2008 17:04:00
Salim

Hallo zusammen,
habe versucht mir eine Userform zu basteln, um sortieren zu können, nach 3 Kriterien.
Ich schaffe es nicht, irgendwas passt da nicht, offensichtlich!
Wäre super, wenn jemand von euch ein Blick drauf werfen könnte. Ich würde gerne den Code zum laufen bringen aber auch verstehen wo der Bug ist (wahrscheinlich die Bugs sind).
Vielen Dank
Salim

Private Sub CommandButton1_Click()
Dim a As Integer
Me.Hide
Set a = ComboBox1.Value
Set b = ComboBox2.Value
Set c = ComboBox3.Value
Set d = Optionsbutton1.Value 'ab- oder aufsteigend: wie baut man das ein?
Set e = Optionsbutton3.Value
Set f = Optionsbutton5.Value
Worksheets("Produits").Rows("3:5001").Sort _
Key1:=a, Order1:=xlAscending, _
header:=xlNo, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
Worksheets("Produits").Rows("3:5001").Sort _
Key2:=b, Order1:=xlAscending, _
header:=xlNo, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
Worksheets("Produits").Rows("3:5001").Sort _
Key3:=c, Order1:=xlAscending, _
header:=xlNo, OrderCustom:=1, _
MatchCase:=False, Orientation:=xlTopToBottom
If ComboBox1.Value  "" Then ComboBox1.Value = ""
End If
If ComboBox2.Value  "" Then ComboBox2.Value = ""
End If
If ComboBox3.Value  "" Then ComboBox3.Value = ""
End If
If Optionsbutton1.Value  "" Then Optionsbutton1.Value = ""
End If
If Optionsbutton2.Value  "" Then Optionsbutton2.Value = ""
End If
If Optionsbutton3.Value  "" Then Optionsbutton3.Value = ""
End If
If Optionsbutton4.Value  "" Then Optionsbutton4.Value = ""
End If
If Optionsbutton5.Value  "" Then Optionsbutton5.Value = ""
End If
If Optionsbutton6.Value  "" Then Optionsbutton6.Value = ""
End If
End Sub



Private Sub CommandButton2_Click()
Me.Hide
ComboBox1.Value = ""
ComboBox2.Value = ""
ComboBox3.Value = ""
Optionsbutton1.Value = ""
Optionsbutton2.Value = ""
Optionsbutton3.Value = ""
Optionsbutton4.Value = ""
Optionsbutton5.Value = ""
Optionsbutton6.Value = ""
Unload.Me
End Sub


Anzeige

1
Beitrag zum Forumthread
Beitrag zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Userform zum Sortieren
25.09.2008 14:04:00
Hajo_Zi
Hallo Salim,
warum sortierst Du nicht mit einmal nach 3 Bedingungen? Benutze doch für den Code den Makrorecorder.

Anzeige

Forumthreads zu verwandten Themen

Anzeige
Anzeige
Anzeige
Anzeige
Entdecke relevante Threads

Schau dir verwandte Threads basierend auf dem aktuellen Thema an

Alle relevanten Threads mit Inhaltsvorschau entdecken
Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige