Como visualizar un registro de un formulario en una hoja de excel

Hola Dante Amor

Te explico que es lo que requiero

como te comente en una preguenta anterior con esta linea Cells(u + 6, 10) = total.Value ya me mustra el valor del total de empaques  de esta forma 

lo que necesito es que sea al reves es decir  de esta forma 

Que sea el primero que aparezca y ya posteriormente los demas

1 respuesta

Respuesta
1

Te anexo la actualización

Private Sub Cmd_Guardar_Click()
'
    'VALIDACIONES
    existe = False
    For Each ctx In Controls
        If TypeOf ctx Is MSForms.ComboBox Or _
           TypeOf ctx Is MSForms.TextBox Or _
           TypeOf ctx Is MSForms.CheckBox Then
            ctx.BackColor = &H80000005
        End If
    Next
    'Controles de combo
        cmbs = Array(Cmbx_Operador, Mot_1, Mot_2)
        For i = LBound(cmbs) To UBound(cmbs)
            If cmbs(i).Value = "" Or cmbs(i).ListIndex = -1 Then
                existe = True
                cmbs(i).BackColor = RGB(255, 0, 0)
            End If
        Next
    'Controles de texto
        txts = Array(sap, Plza, sucursal, Camioneta, fecha, _
                    Sku1, descripcion_uno, Sku2, descripcion_dos, _
                    Sku3, descripcion_tres, Sku4, descripcion_cuatro, _
                    promo1, descripcion_cinco, promo2, descripcion_seis, _
                    comentarios)
        For i = LBound(txts) To UBound(txts)
            If txts(i).Value = "" Then
                existe = True
                txts(i).BackColor = RGB(255, 0, 0)
            End If
        Next
    'Controles de checkbox
        If uno_si.Value = False And uno_no.Value = False Then
            uno_si.BackColor = RGB(255, 0, 0)
            existe = True
        End If
        If dos_si.Value = False And dos_no.Value = False Then
            dos_si.BackColor = RGB(255, 0, 0)
            existe = True
        End If
    'Controles de número
        nums = Array(empaque, Cant_1, Cant_2, Cant_3, Cant_4, Cant_5, Cant_6, total)
        For i = LBound(nums) To UBound(nums)
            If nums(i).Value = "" Or Not IsNumeric(nums(i).Value) Then
                existe = True
                nums(i).BackColor = RGB(255, 0, 0)
            End If
        Next
    '
    If existe Then
        MsgBox "Existen errores en la captura. Revisar"
        Exit Sub
    End If
    '
    'Si ya no existen errores, entonces se guarda la información en la hoja
    Sheets("ENC").Select
    u = Range("A" & Rows.Count).End(xlUp).Row + 1
    For i = 0 To 6
        Cells(u + i, 1) = sap.Text
        Cells(u + i, 2) = Plza.Text
        Cells(u + i, 3) = sucursal.Text
        Cells(u + i, 4) = Cmbx_Operador.Text
        Cells(u + i, 5) = Camioneta.Text
        Cells(u + i, 6) = fecha.Text
        Cells(u + i, 7) = empaque.Text
        '
        Cells(u + i, 11) = comentarios.Value
        Cells(u + i, 12) = IIf(uno_si, "Si", "No")
        Cells(u + i, 13) = Mot_1.Value
        Cells(u + i, 14) = IIf(dos_si, "Si", "No")
        Cells(u + i, 15) = Mot_2.Value
    Next
    '
    Cells(u, 10) = total.Value
    Cells(u + 1, 8) = Sku1.Value
    Cells(u + 1, 9) = descripcion_uno.Value
    Cells(u + 1, 10) = Cant_1.Value
    Cells(u + 2, 8) = Sku2.Value
    Cells(u + 2, 9) = descripcion_dos.Value
    Cells(u + 2, 10) = Cant_2.Value
    Cells(u + 3, 8) = Sku3.Value
    Cells(u + 3, 9) = descripcion_tres.Value
    Cells(u + 3, 10) = Cant_3.Value
    Cells(u + 4, 8) = Sku4.Value
    Cells(u + 4, 9) = descripcion_cuatro.Value
    Cells(u + 4, 10) = Cant_4.Value
    Cells(u + 5, 8) = promo1.Value
    Cells(u + 5, 9) = descripcion_cinco.Value
    Cells(u + 5, 10) = Cant_5.Value
    Cells(u + 6, 8) = promo2.Value
    Cells(u + 6, 9) = descripcion_seis.Value
    Cells(u + 6, 10) = Cant_6.Value
    '
    usuario = Application.UserName
    Mensaje = usuario & " " & "¿Desea continuar capturando ?" & " " & Now 'Define el mensaje
    Estilo = vbYesNo + vbCritical + vbDefaultButton2 ' Define los botones  que se mostrarán
    Titulo = "Base Captura ALEN" 'Define el titulo que se mostrará en la ventana
    Ayuda = "DEMO.HLP" ' Define el archivo de ayuda
    Ctxt = 1000 'Define el tema 'El texto 'Muestra el mensaje
    If MsgBox(Mensaje, Estilo, Titulo, Ayuda, Ctxt) = vbNo Then
        Unload Me
        Exit Sub
    End If
    '
    For Each ctx In Controls
        If TypeOf ctx Is MSForms.ComboBox Or _
           TypeOf ctx Is MSForms.TextBox Then
                ctx.Value = ""
        End If
        If TypeOf ctx Is MSForms.CheckBox Then
            ctx.Value = False
        End If
    Next
    sap.SetFocus
End Sub

Muchas gracias Dante por tu enorme ayuda

 si tengo cualquier duda no dudare en consultarte

saludos y un abrazo

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas