limpiar textbox
Publicado por Jorge leon (27 intervenciones) el 30/09/2014 21:30:49
Hola amigos de LWP, tengo un userform con varios textbox para registrar información a una hoja de calculo excel 2010 y me funciona bien… el problema que tengo, es que al querer limpiar los textbox para otro registro no me lo permite ya que estoy utilizando el siguiente codigo….porque requiero validar la información
En textbox1….
Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1.Text) And TextBox1.Text <> "" Then
Beep
MsgBox "Se debe ingresar solo números"
TextBox1.Text = ""
TextBox1.SetFocus
End If
End Sub
Y en textbox2….
Private Sub TextBox2_Change()
TextBox2.Text = UCase(TextBox2.Text)
If IsNumeric(TextBox2) Then
Beep
MsgBox "Se debe ingresar solo Texto"
TextBox2.Text = ""
TextBox2.SetFocus
End If
If TextBox2.Text = " " Then
Beep
MsgBox "Se debe ingresar solo Texto"
TextBox2.Text = ""
TextBox2.SetFocus
End If
End Sub
De antemano gracias por su apoyo……….. su amigo Jorge
En textbox1….
Private Sub TextBox1_Change()
If Not IsNumeric(TextBox1.Text) And TextBox1.Text <> "" Then
Beep
MsgBox "Se debe ingresar solo números"
TextBox1.Text = ""
TextBox1.SetFocus
End If
End Sub
Y en textbox2….
Private Sub TextBox2_Change()
TextBox2.Text = UCase(TextBox2.Text)
If IsNumeric(TextBox2) Then
Beep
MsgBox "Se debe ingresar solo Texto"
TextBox2.Text = ""
TextBox2.SetFocus
End If
If TextBox2.Text = " " Then
Beep
MsgBox "Se debe ingresar solo Texto"
TextBox2.Text = ""
TextBox2.SetFocus
End If
End Sub
De antemano gracias por su apoyo……….. su amigo Jorge
Valora esta pregunta
0