Live-Forum - Die aktuellen Beiträge
Anzeige
Archiv - Navigation
1008to1012
Aktuelles Verzeichnis
Verzeichnis Index
Übersicht Verzeichnisse
Vorheriger Thread
Rückwärts Blättern
Nächster Thread
Vorwärts blättern
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
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


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

299 Forumthreads zu ähnlichen Themen

Anzeige
Anzeige
Anzeige

Links zu Excel-Dialogen

Beliebteste Forumthreads (12 Monate)

Anzeige

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige