publicado el 17 de febrero11 años buenos días, quería pedir la siguiente ayuda me gustaría saber como podría hacer que el botón que tengo en el archivo me copie la información de los textbox que están en la hoja ventanaproveedores a la hoja baseproveedores ejemplo.xls
publicado el 17 de febrero11 años Incluye este código en la Hoja1, no en un módulo. Faltan datos y la información del código se basa en un Label, pero el resto lo podrías incluir así.... Private Sub CommandButton1_Click() primvacia = Sheets("BaseProveedores").Range("b20000").End(xlUp).Row + 1 Sheets("BaseProveedores").Range("b" & primvacia) = TextBox1.Value Sheets("BaseProveedores").Range("c" & primvacia) = TextBox5.Value Sheets("BaseProveedores").Range("d" & primvacia) = TextBox4.Value Sheets("BaseProveedores").Range("e" & primvacia) = TextBox3.Value Sheets("BaseProveedores").Range("j" & primvacia) = TextBox2.Value Sheets("BaseProveedores").Range("k" & primvacia) = TextBox6.Value Sheets("BaseProveedores").Range("m" & primvacia) = TextBox8.Value End Sub[/CODE] Un saludo, Tese
publicado el 17 de febrero11 años Hola @[uSER=167675]vikthorius[/uSER] Revisa el adjunto, le agregue una macro para pasar los datos que texbox, tienes que habilitar el libro Excel para macros, para que funcione correctamente. ejemplo.xls
publicado el 17 de febrero11 años Prueba este ejemplo . Google Drive Private Sub CommandButton1_Click() Unload Me Sheets("INGRESO VISITAS").Activate formvisitas.Show End Sub Private Sub EMPRESA_Change() If Val(EMPRESA) <> Text Then EMPRESA = "": Exit Sub End Sub Private Sub Image1_Click() End Sub Private Sub Label15_Click() End Sub Private Sub CEDULA_Change() End Sub Private Sub Label8_Click() End Sub Private Sub nombre_Change() If Val(NOMBRE) <> Text Then NOMBRE = "": Exit Sub If NOMBRE = "" Then Exit Sub End Sub Private Sub OFICIAL_Change() If Val(OFICIAL) <> Text Then OFICIAL = "": Exit Sub End Sub Private Sub REGISTRAR_Click() Dim ultimafila As Long If Not CEDULA.Text = "" Then ultimafila = 2 Do Until Sheets("Lista de VISITANTES").Cells(ultimafila, 1) = "" ultimafila = ultimafila + 1 Loop Sheets("Lista de VISITANTES").Cells(ultimafila, 1) = CEDULA Sheets("Lista de VISITANTES").Cells(ultimafila, 2) = NOMBRE Sheets("Lista de VISITANTES").Cells(ultimafila, 3) = EMPRESA Sheets("Lista de VISITANTES").Cells(ultimafila, 4) = TELEFONO Sheets("Lista de VISITANTES").Cells(ultimafila, 5) = OFICIAL End If CEDULA = "" NOMBRE = "" EMPRESA = "" TELEFONO = "" OFICIAL = "" End Sub Private Sub SALIR_Click() Unload Me End Sub Private Sub rVISITANTENUEVO_Click() End Sub Private Sub TELEFONO_Change() End Sub Private Sub Guardar_Click() ActiveWorkbook.Save Sheets("Lista de VISITANTES").Visible = True Unload Me End Sub Private Sub buscaceldavacia() Dim filavacia As Long If Not CEDULA.Text = "" Then filavacia = 3 Do Until Sheets("datos").Cells(filavacia, 1) = "" filavacia = filavacia + 1 Loop Sheets("datos").Cells(filavacia, 1) = CEDULA Sheets("datos").Cells(filavacia, 2) = NOMBRE Sheets("datos").Cells(filavacia, 3) = EMPRESA Sheets("datos").Cells(filavacia, 4) = OFICIAL End If End Sub Private Sub UserForm_Click() End Sub [/CODE]
buenos días, quería pedir la siguiente ayuda me gustaría saber como podría hacer que el botón que tengo en el archivo me copie la información de los textbox que están en la hoja ventanaproveedores a la hoja baseproveedores
ejemplo.xls