How to set Range reaching the last row?

F

fred

Hello,
Some functions allow specifying the range the following way:
Range("A1:A10")

How to include the last (max) row in that instead of A10?
Thanks,
Fred
 
G

Gary''s Student

Sub RangeROver()
Dim r As Range
Set r = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
End Sub
 

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

Top