Tengo este código y me gustaria saber si hay alguna forma de acortarlo un poco.
Cita:
Bueno, esto va así sucesivamente, tengo unos 300 forms que me indica los datos según se pulse, quisiera si hay una forma de acortar código.Private Sub Command1_Click(Index As Integer)
Text1 ="+0,00"
Text2="+6,00"
TR
End Sub
Private Sub Command2_Click(Index As Integer)
Text1 ="+5,75"
Select Case Index
Case 0: Text1="+0,00":TR
Case 1: Text1="+0,25":TR
End Select
End Sub
Private Sub Command3_Click(Index As Integer)
Text1 ="+5,50"
Select Case Index
Case 0: Text1="+0,00":TR
Case 1: Text1="+0,25":TR
Case 2: Text1="+0,50":TR
End Select
End Sub
Private Sub TR()
Text3= Text1 * (-1)
Text4= Text2 - Text1
End Sub
Text1 ="+0,00"
Text2="+6,00"
TR
End Sub
Private Sub Command2_Click(Index As Integer)
Text1 ="+5,75"
Select Case Index
Case 0: Text1="+0,00":TR
Case 1: Text1="+0,25":TR
End Select
End Sub
Private Sub Command3_Click(Index As Integer)
Text1 ="+5,50"
Select Case Index
Case 0: Text1="+0,00":TR
Case 1: Text1="+0,25":TR
Case 2: Text1="+0,50":TR
End Select
End Sub
Private Sub TR()
Text3= Text1 * (-1)
Text4= Text2 - Text1
End Sub
También si me podeis ayudar en formato de los números, quisiera que en Text3 y Text4 me saliera los números con dos decimales y con el signo + ó - delante.
Un saludo y gracias.