Select last cell in range

P

PaulSin

I can't remember how I did this last time.....
I've got a range of cells and I need to go to the last cell to paste i
a load of new data.
I can use Selection.End(xlDown) fine to get to the last cell, but the
I want to offset one cell down. The code I have for the offset i
Cell.Offset(1,0).Select, but this comes back with an error saying i
needs an object. Any ideas on what I'm doing wrong?
Thanks
Pau
 
P

Pete McCosh

Paul,

the problem here is that the OFFSET needs to be based on a
Range object. Despite it's sugestive name, Cell isn't one,
although it's entirely possible that it was an Object
variable in the earlier code you had.

Once you get to the bottom of the region, you can use:

ActiveCell.Offset(1,0).Select

Alternatively, you can combine the two into:

ActiveCell.End(xlDown).Offset(1,0).Select

However, this method can be susceptible to errors caused
by unexpected breaks or blanks in your data, so it's often
best to work from the bottom up:

Range("A65536").End(xlUp).Offset(1,0).Select

Cheers, Pete.
 
L

Libby

Hi
Just put the offset bit directly after. eg
Selection.End(xlDown).Offset(1, 0).Select
 
Top