ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Last Row range (https://www.excelbanter.com/excel-discussion-misc-queries/223886-last-row-range.html)

wal50

Last Row range
 
I can usually find a similar previous question but not this time.
I can find the last row:
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row

How do I select a range of columns in the last row +1?
My butchered attempt that doesn't work:
Range(E" & lastrow + 1":L" & lastrow +1").select

Thanks in advance.
wal50



Mike H

Last Row range
 
Hi,

One way

Cells(Rows.Count, "E").End(xlUp).Offset(1).Resize(, 8).Select

Mike

"wal50" wrote:

I can usually find a similar previous question but not this time.
I can find the last row:
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row

How do I select a range of columns in the last row +1?
My butchered attempt that doesn't work:
Range(E" & lastrow + 1":L" & lastrow +1").select

Thanks in advance.
wal50



Sheeloo[_3_]

Last Row range
 
Use
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("E" & lastrow & ":L" & lastrow).Select
-----------------
Notice that I have already added 1 to the lastrow

Compare what you had
Range(E" & lastrow + 1":L" & lastrow +1").select
with what I have above....
You missed the " before E, & after before ":L" and had extra quote at the
end...
Again remember: variable don't need quotes, strings do... & between two
components


"wal50" wrote:

I can usually find a similar previous question but not this time.
I can find the last row:
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row

How do I select a range of columns in the last row +1?
My butchered attempt that doesn't work:
Range(E" & lastrow + 1":L" & lastrow +1").select

Thanks in advance.
wal50



wal50

Last Row range
 
Thank you for the prompt response. A terrific site
wal50

"Sheeloo" wrote:

Use
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row + 1
Range("E" & lastrow & ":L" & lastrow).Select
-----------------
Notice that I have already added 1 to the lastrow

Compare what you had
Range(E" & lastrow + 1":L" & lastrow +1").select
with what I have above....
You missed the " before E, & after before ":L" and had extra quote at the
end...
Again remember: variable don't need quotes, strings do... & between two
components


"wal50" wrote:

I can usually find a similar previous question but not this time.
I can find the last row:
Dim lastrow As Long
lastrow = Cells(Rows.Count, "A").End(xlUp).Row

How do I select a range of columns in the last row +1?
My butchered attempt that doesn't work:
Range(E" & lastrow + 1":L" & lastrow +1").select

Thanks in advance.
wal50




All times are GMT +1. The time now is 07:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com