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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
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,215,443
Messages
6,124,889
Members
449,193
Latest member
ronnyf85

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