Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select last cell in range
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 -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select last cell in range
cells(selection.end(xldown).row + 1, selection.column).select
"PaulSin " wrote in message ... 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 in a load of new data. I can use Selection.End(xlDown) fine to get to the last cell, but then I want to offset one cell down. The code I have for the offset is Cell.Offset(1,0).Select, but this comes back with an error saying it needs an object. Any ideas on what I'm doing wrong? Thanks Paul --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select last cell in range
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. -----Original Message----- 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 in a load of new data. I can use Selection.End(xlDown) fine to get to the last cell, but then I want to offset one cell down. The code I have for the offset is Cell.Offset(1,0).Select, but this comes back with an error saying it needs an object. Any ideas on what I'm doing wrong? Thanks Paul --- Message posted from http://www.ExcelForum.com/ . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Select last cell in range
Hi
Just put the offset bit directly after. eg Selection.End(xlDown).Offset(1, 0).Select -----Original Message----- 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 in a load of new data. I can use Selection.End(xlDown) fine to get to the last cell, but then I want to offset one cell down. The code I have for the offset is Cell.Offset(1,0).Select, but this comes back with an error saying it needs an object. Any ideas on what I'm doing wrong? Thanks Paul --- Message posted from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Select the first cell of the last row in a range - Excel 2003 | New Users to Excel | |||
how can I select a range of cells based on a value of a cell? | Excel Discussion (Misc queries) | |||
select first cell in unmerged range | Excel Discussion (Misc queries) | |||
How to select a range whose name is entered in a cell. | Excel Worksheet Functions | |||
select last cell in used range | Excel Programming |