Inicial Final
1 9
3 5
2 3
10 2
9 10
5 1
Este es el algoritmo de ordenamiento
DIM limite AS Integer
DIM cambio1 AS String
DIM i AS Integer, j AS Integer, col AS Integer
TIni.Rows.Count -= 1
TIni.Visible = FALSE '<---- Ignoren Esto
limite = TIni.Rows.Count - 1 '<---- Ignoren Esto
FOR i = 0 TO limite - 2
FOR j = 0 TO limite - 1
IF UCase$(TIni[j, 0].Text) < UCase$(TIni[j + 1, 0].Text) THEN
Message.Info("Cambio")
FOR col = 0 TO TIni.Columns.Count - 1
cambio1 = TIni[j, col].Text
TIni[j, col].Text = TIni[j + 1, col].Text
TIni[j + 1, col].Text = cambio1
NEXT
END IF
NEXT
NEXT
TIni.visible = TRUE '<---- Ignoren Esto
DIM cambio1 AS String
DIM i AS Integer, j AS Integer, col AS Integer
TIni.Rows.Count -= 1
TIni.Visible = FALSE '<---- Ignoren Esto
limite = TIni.Rows.Count - 1 '<---- Ignoren Esto
FOR i = 0 TO limite - 2
FOR j = 0 TO limite - 1
IF UCase$(TIni[j, 0].Text) < UCase$(TIni[j + 1, 0].Text) THEN
Message.Info("Cambio")
FOR col = 0 TO TIni.Columns.Count - 1
cambio1 = TIni[j, col].Text
TIni[j, col].Text = TIni[j + 1, col].Text
TIni[j + 1, col].Text = cambio1
NEXT
END IF
NEXT
NEXT
TIni.visible = TRUE '<---- Ignoren Esto
Saludo