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

Valentin Baeza

New Member
Joined
Apr 25, 2018
Messages
7
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
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
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
 
Upvote 0

Forum statistics

Threads
1,215,208
Messages
6,123,644
Members
449,111
Latest member
ghennedy

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
Back
Top