Last Row range

W

wal50

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
 
S

Sheeloo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Macro range 2
Is not sorting 4
Find last row with data 3
Paste cell to last row in range 6
Creating a fixture list 3
Collate data 1
Macro copy from range 3
Macro Question 3

Top