hola Alvaro esto es lo que entendi
para sacar los digitos, mostrar el digito mas grande, y el mas chico:
para el ejemplo necesite
9 textbox y cuatro botones
escribe el numero en el text1
solo da click en el command1 hasta que el text1 se vacie
el command2 es para limpiar las cajas
el command3 es para sacar el digito mas grande
el command4 es para sacar el digito mas chico
codigo fuente:
el codigo es facil de entender
si deseas el codigo de ejemplo mi mail para mandartelo es:
[email protected]
==========================================
Private Sub Command1_Click()
c = Mid(Text1, 1, 2)
If Len(Text1) = 1 Then Text1.Text = "": Exit Sub
If Text2 = "" Then Text2.SelText = c: GoTo borrar
If (Text2 <> "") And (Text3 = "") Then Text3.SelText = c: GoTo borrar
If (Text3 <> "") And (Text4 = "") Then Text4.SelText = c: GoTo borrar
If (Text4 <> "") And (Text5 = "") Then Text5.SelText = c: GoTo borrar
If (Text5 <> "") And (Text6 = "") Then Text6.SelText = c: GoTo borrar
If (Text6 <> "") And (Text7 = "") Then Text7.SelText = c: GoTo borrar
If (Text7 <> "") And (Text8 = "") Then Text8.SelText = c: GoTo borrar
Exit Sub
borrar:
Text1.SetFocus
SendKeys "{home}"
SendKeys "{del}"
SendKeys "{del}"
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
End Sub
Rem sacar el digito mas grande
Private Sub Command3_Click()
a = Len(Text9)
If a = 2 Then Text9.Text = "": Exit Sub
If Text2 > Text3 Then
Text9.SelText = Text2
ElseIf Text3 > Text2 Then
Text9.SelText = Text3
End If
If Text4 = "" Then Exit Sub
If Text4 > Text9 Then
Text9.Text = Text4
ElseIf Text4 < Text9 Then
Exit Sub
End If
If Text5 = "" Then Exit Sub
If Text5 > Text9 Then
Text9.Text = Text5
ElseIf Text5 < Text9 Then
Exit Sub
End If
If Text6 = "" Then Exit Sub
If Text6 > Text9 Then
Text9.Text = Text6
ElseIf Text6 < Text9 Then
Exit Sub
End If
If Text7 = "" Then Exit Sub
If Text7 > Text9 Then
Text9.Text = Text7
ElseIf Text7 < Text9 Then
Exit Sub
End If
If Text8 = "" Then Exit Sub
If Text8 > Text9 Then
Text9.Text = Text8
ElseIf Text8 < Text9 Then
Exit Sub
End If
End Sub
Rem sacar el digito mas chico
Private Sub Command4_Click()
a = Len(Text9)
If a = 2 Then Text9.Text = "": Exit Sub
If Text2 < Text3 Then
Text9.SelText = Text2
ElseIf Text3 > Text2 Then
Text9.SelText = Text3
End If
If Text4 = "" Then Exit Sub
If Text4 < Text9 Then
Text9.Text = Text4
ElseIf Text4 < Text9 Then
Exit Sub
End If
If Text5 = "" Then Exit Sub
If Text5 < Text9 Then
Text9.Text = Text5
ElseIf Text5 < Text9 Then
Exit Sub
End If
If Text6 = "" Then Exit Sub
If Text6 < Text9 Then
Text9.Text = Text6
ElseIf Text6 < Text9 Then
Exit Sub
End If
If Text7 = "" Then Exit Sub
If Text7 < Text9 Then
Text9.Text = Text7
ElseIf Text7 < Text9 Then
Exit Sub
End If
If Text8 = "" Then Exit Sub
If Text8 < Text9 Then
Text9.Text = Text8
ElseIf Text8 < Text9 Then
Exit Sub
End If
End Sub