vb@rchiv
VB Classic
VB.NET
ADO.NET
VBA
C#
Erstellen von dynamischen Kontextmen?s - wann immer Sie sie brauchen!  
 vb@rchiv Quick-Search: Suche startenErweiterte Suche starten   Impressum  | Datenschutz  | vb@rchiv CD Vol.6  | Shop Copyright ©2000-2025
 
zurück

 Sie sind aktuell nicht angemeldet.Funktionen: Einloggen  |  Neu registrieren  |  Suchen

Visual-Basic Einsteiger
Alternative zum BubbleSort 
Autor: Lord_Duke
Datum: 27.09.05 09:47

Aloa also hab n Problem muss ne ExcelTabelle sortieren und mache das derzeit mit dem BubbleSort verfahren. die Sortierfunktion von Excel selbst is mir zu unsauber und suche jetzt ne alternative.

kann mir da wer helfen??

Ach ja und nich wundern hab erst nachdem ich fertig war gemerkt, das ik BubbleSort geprogt habe war wie im rausch hab mir was überlegt und BubbleSort kam raus...

mir isses nur zu langsam kanns auch in Array einlesen und will erstmal wissen ob wer ne andere lösung weiss....

Sub Daten_Sortieren_Bubble()
'##### Bubblesortverfahren aber langsam (suche nach anderer Möglichkeit) #####
i = 2
Do While Tabelle1.Cells(i, 19) <> ""
DoEvents
i = i + 1
Loop
z = i - 1
p = 2
Abbruch = 0
Do While (p <> z) And (Abbruch <> 1)
m = 2
Wechselwert = 0
Do While (m <> z)
If Tabelle1.Cells(m, 19) > Tabelle1.Cells(m + 1, 19) Then
Wert1 = Tabelle1.Cells(m, 1)
Wert2 = Tabelle1.Cells(m, 2)
Wert3 = Tabelle1.Cells(m, 3)
Wert4 = Tabelle1.Cells(m, 4)
Wert5 = Tabelle1.Cells(m, 5)
Wert6 = Tabelle1.Cells(m, 6)
Wert7 = Tabelle1.Cells(m, 7)
Wert8 = Tabelle1.Cells(m, 8)
Wert9 = Tabelle1.Cells(m, 9)
Wert10 = Tabelle1.Cells(m, 10)
Wert11 = Tabelle1.Cells(m, 11)
Wert12 = Tabelle1.Cells(m, 12)
Wert13 = Tabelle1.Cells(m, 13)
Wert14 = Tabelle1.Cells(m, 14)
Wert15 = Tabelle1.Cells(m, 15)
Wert16 = Tabelle1.Cells(m, 16)
Wert17 = Tabelle1.Cells(m, 17)
Wert18 = Tabelle1.Cells(m, 18)
Wert19 = Tabelle1.Cells(m, 19)
Wert20 = Tabelle1.Cells(m, 20)
Wert21 = Tabelle1.Cells(m, 21)
Wert22 = Tabelle1.Cells(m, 22)
Wert23 = Tabelle1.Cells(m, 23)
Tabelle1.Cells(m, 1) = Tabelle1.Cells(m + 1, 1)
Tabelle1.Cells(m, 2) = Tabelle1.Cells(m + 1, 2)
Tabelle1.Cells(m, 3) = Tabelle1.Cells(m + 1, 3)
Tabelle1.Cells(m, 4) = Tabelle1.Cells(m + 1, 4)
Tabelle1.Cells(m, 5) = Tabelle1.Cells(m + 1, 5)
Tabelle1.Cells(m, 6) = Tabelle1.Cells(m + 1, 6)
Tabelle1.Cells(m, 7) = Tabelle1.Cells(m + 1, 7)
Tabelle1.Cells(m, 8) = Tabelle1.Cells(m + 1, 8)
Tabelle1.Cells(m, 9) = Tabelle1.Cells(m + 1, 9)
Tabelle1.Cells(m, 10) = Tabelle1.Cells(m + 1, 10)
Tabelle1.Cells(m, 11) = Tabelle1.Cells(m + 1, 11)
Tabelle1.Cells(m, 12) = Tabelle1.Cells(m + 1, 12)
Tabelle1.Cells(m, 13) = Tabelle1.Cells(m + 1, 13)
Tabelle1.Cells(m, 14) = Tabelle1.Cells(m + 1, 14)
Tabelle1.Cells(m, 15) = Tabelle1.Cells(m + 1, 15)
Tabelle1.Cells(m, 16) = Tabelle1.Cells(m + 1, 16)
Tabelle1.Cells(m, 17) = Tabelle1.Cells(m + 1, 17)
Tabelle1.Cells(m, 18) = Tabelle1.Cells(m + 1, 18)
Tabelle1.Cells(m, 19) = Tabelle1.Cells(m + 1, 19)
Tabelle1.Cells(m, 20) = Tabelle1.Cells(m + 1, 20)
Tabelle1.Cells(m, 21) = Tabelle1.Cells(m + 1, 21)
Tabelle1.Cells(m, 22) = Tabelle1.Cells(m + 1, 22)
Tabelle1.Cells(m, 23) = Tabelle1.Cells(m + 1, 23)
Tabelle1.Cells(m + 1, 1) = Wert1
Tabelle1.Cells(m + 1, 2) = Wert2
Tabelle1.Cells(m + 1, 3) = Wert3
Tabelle1.Cells(m + 1, 4) = Wert4
Tabelle1.Cells(m + 1, 5) = Wert5
Tabelle1.Cells(m + 1, 6) = Wert6
Tabelle1.Cells(m + 1, 7) = Wert7
Tabelle1.Cells(m + 1, 8) = Wert8
Tabelle1.Cells(m + 1, 9) = Wert9
Tabelle1.Cells(m + 1, 10) = Wert10
Tabelle1.Cells(m + 1, 11) = Wert11
Tabelle1.Cells(m + 1, 12) = Wert12
Tabelle1.Cells(m + 1, 13) = Wert13
Tabelle1.Cells(m + 1, 14) = Wert14
Tabelle1.Cells(m + 1, 15) = Wert15
Tabelle1.Cells(m + 1, 16) = Wert16
Tabelle1.Cells(m + 1, 17) = Wert17
Tabelle1.Cells(m + 1, 18) = Wert18
Tabelle1.Cells(m + 1, 19) = Wert19
Tabelle1.Cells(m + 1, 20) = Wert20
Tabelle1.Cells(m + 1, 21) = Wert21
Tabelle1.Cells(m + 1, 22) = Wert22
Tabelle1.Cells(m + 1, 23) = Wert23
Wechselwert = Wechselwert + 1
End If
m = m + 1
DoEvents
Loop
If Wechselwert = 0 Then
Abbruch = 1
End If
p = p + 1
DoEvents
Loop
End Sub

MfG Lord_Duke
a.k.a. Loki

Design is 4 your Life and not for the others

________________________________________________________________
Windows XP Prof. SP 2 @ 2X 3,45 GHz P4 D ( 830) // DDR2 1024 MB //
GeForce 6600 GT Silent Pipe // 500 GB HDD

alle Nachrichten anzeigenGesamtübersicht  |  Zum Thema  |  Suchen

 ThemaViews  AutorDatum
Alternative zum BubbleSort537Lord_Duke27.09.05 09:47
Re: Alternative zum BubbleSort622ModeratorDieter27.09.05 10:51
Re: Alternative zum BubbleSort335Lord_Duke27.09.05 11:54
Re: Alternative zum BubbleSort490Dirk28.09.05 08:58

Sie sind nicht angemeldet!
Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.

Einloggen  |  Neu registrieren

Funktionen:  Zum Thema  |  GesamtübersichtSuchen 

nach obenzurück
 
   

Copyright ©2000-2025 vb@rchiv Dieter Otter
Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.

Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel