Guardar ingresos del formulario de arriba hacia abajo
Tengo el siguiente código:
Public Sub btn_guardar_Click()
Set h = Sheets("REGISTRO")
Set h2 = Sheets("DATOS")
u = 2
Do While h.Cells(u, "B") <> ""
u = u + 1
Loop
ab1 = combo_Entrantes.List(combo_Entrantes.ListIndex, 1)
ab2 = combo_Salientes.List(combo_Salientes.ListIndex, 1)
If ab2 <> "" Then ab1 = "x" & ab1
ab12 = ab2 & ab1
'
.....
End If
If ab1 <> "" Then ab1 = "x" & ab1
h.Cells(u, "A") = txtbox_pos
h.Cells(u, "B") = cad
h.Cells(u, "C") = Date
h.Cells(u, "D") = "IM" & form_IMS.txtbox_IM.Value
h.Cells(u, "E") = form_IMS.combo_Entrantes.Value
h.Cells(u, "F") = form_IMS.txtbox_serieEntrante.Value
h.Cells(u, "G") = form_IMS.combo_Salientes.Value
h.Cells(u, "H") = form_IMS.txtbox_serieSaliente.Value
h.Cells(u, "I") = form_IMS.combo_sim1Entrante.Value
h.Cells(u, "J") = form_IMS.txtbox_serieSimEntrante.Value
h.Cells(u, "K") = form_IMS.combo_sim1Saliente.Value
h.Cells(u, "L") = form_IMS.txtbox_serieSim1Saliente.Value
h.Cells(u, "M") = form_IMS.combo_sim2Entrante.Value
h.Cells(u, "N") = form_IMS.txtbox_serieSim2Entrante.Value
h.Cells(u, "O") = form_IMS.combo_sim2Saliente.Value
h.Cells(u, "P") = form_IMS.txtbox_serieSim2Saliente.Value
h.Cells(u, "Q") = form_IMS.txtbox_detalle.Value
ThisWorkbook.Save
'
'enviar_Correo
'campos_predeterminados
'txtbox_pos.SetFocus
End SubEste me guarda lo ingresado en el formulario en la primera fila vacía que encuentre.
Necesito algo similar pero que me vaya insertando una fila nueva por cada ingreso, de manera que el ingreso más reciente vaya quedando después del encabezado siempre.
Foto de la hoja de registro:

1 Respuesta
Respuesta de Dante Amor
1
