Foro de elhacker.net

Foros Generales => Foro Libre => Mensaje iniciado por: busqueda en 24 Octubre 2017, 20:41 pm



Título: Macros VBA
Publicado por: busqueda en 24 Octubre 2017, 20:41 pm
Buenas tardes.

tengo un problema con mi macros al ejecutar el boton guardar de la macro par registro en tabla de excel. esta informacion si se adiere, el problema es que se ingresa hasta la ultima fila del registro de excel en la celda A65535

este es el comando, si alguien pudiera ayudarme!!!



Private Sub CommandButton1_Click()
Sheets("proveedores").Select Range("A2").Select
If TextBox2 = "" Or TextBox3 = "" Or TextBox5 = "" Or TextBox15 = "" Or TextBox16 = "" Or TextBox17 = "" Or TextBox18 = "" Or TextBox19 = "" Then
MsgBox "Está dejando campos requeridos vacios favor complete", vbExclamation, "Almacen"
TextBox3.SetFocus
Else
Range("A" & Cells.Rows.Count).End(xlUp).Offset(1).Select
ActiveCell = TextBox2.Value
ActiveCell.Offset(0, 1) = TextBox3.Value
ActiveCell.Offset(0, 2) = TextBox5.Value
ActiveCell.Offset(0, 3) = TextBox15.Value
ActiveCell.Offset(0, 4) = TextBox7.Value
ActiveCell.Offset(0, 5) = TextBox13.Value
ActiveCell.Offset(0, 6) = TextBox14.Value
ActiveCell.Offset(0, 7) = TextBox16.Value
ActiveCell.Offset(0, 8) = TextBox17.Value
ActiveCell.Offset(0, 9) = TextBox18.Value
ActiveCell.Offset(0, 10) = TextBox19.Value
MsgBox "Empleado ingresado exitosamente", vbInformation, "Servitap"
TextBox2 = ""
TextBox3 = ""
TextBox5 = ""
TextBox15 = ""
TextBox7 = ""
TextBox13 = ""
TextBox14 = ""
TextBox16 = ""
TextBox17 = ""
TextBox18 = ""
TextBox19 = ""
TextBox2.SetFocus
End If
End Sub