Insertar datos de un formulario en1ª fila vacia de una tabla

Valentin Baeza

New Member
Joined
Apr 25, 2018
Messages
6
Hola, ¿cómo puedo hacer para que los datos de un formulario se incorporen a una tabla en la primera fila vacia?
Tengo esto pero me lo escribe siempre en la fila 18 y yo necesito que, si ya hay datos en la fila 18, cubra la fila 19 con los datos del formulario

Subcomando privadoButton1_Click ()
Hojas de trabajo ("TRABAJADORES"). Rango ("E18"). Valor = Me.Departamento.Value
Hojas de trabajo ("TRABAJADORES"). Rango ("I18"). Valor = Me.Categoria.Value
Hojas de trabajo ("TRABAJADORES"). Rango ("D18"). Valor = Me.Nombre_Alias.Value
Hojas de trabajo ("TRABAJADORES"). Rango ("J18"). Valor = Me.PorcentajeJornada.Value
End Sub

Gracias de antemano
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

afonsomira

Board Regular
Joined
Aug 11, 2020
Messages
62
Office Version
  1. 365
Platform
  1. Windows
Hola.

VBA Code:
Subcomando privadoButton1_Click ()

application.screenupdating = false

'Encuentra la ultima linea de la tabla
UltimaLinea = ActiveSheet.Cells(Rows.Count, 5).End(xlUp).Row

sheets("TRABAJADORES").cells(UltimaLinea,5).value = Me.Departamento.Value
sheets("TRABAJADORES").cells(UltimaLinea,9).value = Me.Categoria.Value
sheets("TRABAJADORES").cells(UltimaLinea,4).value = Me.Nombre_Alias.Value
sheets("TRABAJADORES").cells(UltimaLinea,10).value = Me.PorcentajeJornada.Value

application.screenupdating = true

End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,127,643
Messages
5,626,052
Members
416,158
Latest member
CaliburBlade138

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top