El botón debe permitir ingresar todos los datos a la planilla

Ya que el formulario esta quedando excelente al extaer los datos del archivo adjunto..

Ahora necesito que el botón INGRESAR, debe permitir ingresar todos los datos a la planilla y no olvidar que debe permitir ingresar los datos sin borrar el anterior

1 Respuesta

Respuesta
2

Te anexo la macro

Private Sub CommandButton1_Click()
'Por.Dante Amor
    cad = ""
    If TextBox1 = "" Then cad = cad & "Nombres. "
    If TextBox2 = "" Then cad = cad & "Apellidos. "
    If ComboBox1 = "" Then cad = cad & "Zona. "
    If ComboBox2 = "" Then cad = cad & "Región. "
    If TextBox3 = "" Then cad = cad & "Cod Ciudad. "
    If TextBox4 = "" Then cad = cad & "Teléfono"
    If cad <> "" Then
        MsgBox "Son requeridos los datos: " & cad
        Exit Sub
    End If
    '
    u = h1.Range("A" & Rows.Count).End(xlUp).Row + 1
    h1.Cells(u, "A") = TextBox1
    h1.Cells(u, "B") = TextBox2
    h1.Cells(u, "C") = ComboBox1
    h1.Cells(u, "D") = ComboBox2
    h1.Cells(u, "E") = TextBox3
    h1.Cells(u, "F") = TextBox4
    MsgBox "Datos ingresados", vbInformation
End Sub
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias

Estimado Dante Amor;

La base de datos funciona muy bien, pero necesito saber porque al terminar de ingresar un registro a la base, ¿este permanece en el formulario?

Hay que borrar manualmente los datos NOMBRE, APELLIDOS Y TELÉFONO, ¿para ingresar otro?

El botón INGRESAR, ¿esta o no permitiendo ingresar todos los datos sin borrar el anterior?

Saludos

macontad

H o l a:

Hay que ir afinando poco a poco el formulario.

En la pregunta debes poner con detalle lo necesario para el funcionamiento del botón "Ingresar".

Te anexo la macro actualizada.

Private Sub CommandButton1_Click()
'Por.Dante Amor
    cad = ""
    If TextBox1 = "" Then cad = cad & "Nombres. "
    If TextBox2 = "" Then cad = cad & "Apellidos. "
    If ComboBox1 = "" Then cad = cad & "Zona. "
    If ComboBox2 = "" Then cad = cad & "Región. "
    If TextBox3 = "" Then cad = cad & "Cod Ciudad. "
    If TextBox4 = "" Then cad = cad & "Teléfono"
    If cad <> "" Then
        MsgBox "Son requeridos los datos: " & cad
        Exit Sub
    End If
    '
    u = h1.Range("A" & Rows.Count).End(xlUp).Row + 1
    h1.Cells(u, "A") = TextBox1
    h1.Cells(u, "B") = TextBox2
    h1.Cells(u, "C") = ComboBox1
    h1.Cells(u, "D") = ComboBox2
    h1.Cells(u, "E") = TextBox3
    h1.Cells(u, "F") = TextBox4
    '
    TextBox1 = "" 
    TextBox2 = "" 
    ComboBox1 = "" 
    ComboBox2 = "" 
    TextBox3 = "" 
    TextBox4 = "" 
    '
    MsgBox "Datos ingresados", vbInformation
End Sub

Sal u dos

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas