ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to set Range reaching the last row? (https://www.excelbanter.com/excel-programming/429880-how-set-range-reaching-last-row.html)

fred

How to set Range reaching the last row?
 
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



Gary''s Student

How to set Range reaching the last row?
 
Sub RangeROver()
Dim r As Range
Set r = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
End Sub

--
Gary''s Student - gsnu200856


"fred" wrote:

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





All times are GMT +1. The time now is 11:10 PM.

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