Ingresar datos con formato numérico
Hola por favor si me pueden ayudar
Tengo un formulario para ingresar unos datos y lo tengo de manera que si la celda seleccionada esta llena manda datos al final de la lista en la ultima celda vacia; el problema que tengo es que los datos se ingresan con formato texto ¿como hago para que se vacíen los datos pero en formato numérico o según sea el caso de fecha y que no me deje nada en la celda (a16) por que lo que me manda all final de lalista me queda también en (a16) y el formulario también queda con los datos, como hago para que me quede en blanco para ingresar nuevo dato.
Gracias por la colaboración que me puedan brindar
Estos son los códigos del formulario
Private Sub CommandButton1_Click()
Cells.Find(What:=TextBox1, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.Offset(0, 1).Select
TextBox2 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox3 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox4 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox5 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox6 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox7 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox8 = ActiveCell
End Sub
Private Sub CommandButton3_Click()
Sheets("clientes").Select
Range("a16").Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell = TextBox1
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox2
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox3
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox4
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox5
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox6
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox7
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox8
ActiveCell.Offset(0, 1).Select
End Sub
Private Sub TextBox1_Change()
Range("a16") = Val(TextBox1)
End Sub
Private Sub TextBox2_Change()
Range("b16").FormulaR1C1 = TextBox2
End Sub
Private Sub TextBox3_Change()
Range("c16") = Val(TextBox3)
End Sub
Private Sub TextBox4_Change()
Range("d16").FormulaR1C1 = TextBox4
End Sub
Private Sub TextBox5_Change()
Range("e16").FormulaR1C1 = TextBox5
End Sub
Private Sub TextBox6_Change()
Range("f16") = Val(TextBox6)
End Sub
Private Sub TextBox7_Change()
Range("g16") = Val(TextBox7)
End Sub
Private Sub TextBox8_Change()
Range("h16") = Val(TextBox8)
End Sub
Private Sub commandButton2_click()
Range("a16").Select
Selection.EntireRow.Delete
End Sub
Private Sub commandButton4_click()
End
End Sub
Private Sub UserForm_Click()
End Sub
Tengo un formulario para ingresar unos datos y lo tengo de manera que si la celda seleccionada esta llena manda datos al final de la lista en la ultima celda vacia; el problema que tengo es que los datos se ingresan con formato texto ¿como hago para que se vacíen los datos pero en formato numérico o según sea el caso de fecha y que no me deje nada en la celda (a16) por que lo que me manda all final de lalista me queda también en (a16) y el formulario también queda con los datos, como hago para que me quede en blanco para ingresar nuevo dato.
Gracias por la colaboración que me puedan brindar
Estos son los códigos del formulario
Private Sub CommandButton1_Click()
Cells.Find(What:=TextBox1, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.Offset(0, 1).Select
TextBox2 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox3 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox4 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox5 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox6 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox7 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox8 = ActiveCell
End Sub
Private Sub CommandButton3_Click()
Sheets("clientes").Select
Range("a16").Select
Do While Not IsEmpty(ActiveCell)
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell = TextBox1
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox2
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox3
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox4
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox5
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox6
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox7
ActiveCell.Offset(0, 1).Select
ActiveCell = TextBox8
ActiveCell.Offset(0, 1).Select
End Sub
Private Sub TextBox1_Change()
Range("a16") = Val(TextBox1)
End Sub
Private Sub TextBox2_Change()
Range("b16").FormulaR1C1 = TextBox2
End Sub
Private Sub TextBox3_Change()
Range("c16") = Val(TextBox3)
End Sub
Private Sub TextBox4_Change()
Range("d16").FormulaR1C1 = TextBox4
End Sub
Private Sub TextBox5_Change()
Range("e16").FormulaR1C1 = TextBox5
End Sub
Private Sub TextBox6_Change()
Range("f16") = Val(TextBox6)
End Sub
Private Sub TextBox7_Change()
Range("g16") = Val(TextBox7)
End Sub
Private Sub TextBox8_Change()
Range("h16") = Val(TextBox8)
End Sub
Private Sub commandButton2_click()
Range("a16").Select
Selection.EntireRow.Delete
End Sub
Private Sub commandButton4_click()
End
End Sub
Private Sub UserForm_Click()
End Sub
1 Respuesta
Respuesta de Elsa Matilde
1