Agregar una linea al final de la table

walterw

New Member
Joined
Sep 3, 2002
Messages
4
quiero agregar una linea al final de mi tabla
pero la linea se me agrega una antes??

Sub SI()
'
Dim myRange As Range
Dim ce As Range
Application.Goto Reference:="R1C1"
ActiveCell.CurrentRegion.Select
Set myRange = ActiveCell.CurrentRegion
myRange.CurrentRegion.Select
myRange.Offset(+1, 0).Select
myRange.EntireRow.Select

End Sub


que hago MAL???
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Supongo que por agregar te refieres a "insertar" una fila, aunque si esta al final, salvo que tengas más datos por debajo, pero en otras columnas, no es necesario insertar...

en la siguiente linea

myRange.Offset(+1, 0).Select

lo que haces es desplaxar tu seleccion una fila abajo, pero solo seleccionas

myRange.EntireRow.Select

en la linea anterior, seleccionas TODAS las filas de myRange, no solo una...


Si quieres hacer lo que manifiestas **quiero agregar una linea al final de mi tabla**, la siguiente linea lo hace

Range("A1").End(xlDown).Offset(1, 0).EntireRow.Insert

Suponiendo que tu tabla empieza en A1 y que ya existe por lo menos un registro en ella...





On 2002-09-10 00:16, walterw wrote:
quiero agregar una linea al final de mi tabla
pero la linea se me agrega una antes??

Sub SI()
'
Dim myRange As Range
Dim ce As Range
Application.Goto Reference:="R1C1"
ActiveCell.CurrentRegion.Select
Set myRange = ActiveCell.CurrentRegion
myRange.CurrentRegion.Select
myRange.Offset(+1, 0).Select
myRange.EntireRow.Select

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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