ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Last row as value (https://www.excelbanter.com/excel-programming/333013-last-row-value.html)

sisco98

Last row as value
 
Hi all,

Is there a way to get the last used cell's row number as value? For example,
if the last used cell is in the 78th row, I could get 78 as value.

thanks in advance!
--
sisco98

Fred[_22_]

Last row as value
 
If you want the last row in column A try:

lastRowNo = Range("A65536").End(xlUp).Row


"sisco98" wrote in message
...
Hi all,

Is there a way to get the last used cell's row number as value? For
example,
if the last used cell is in the 78th row, I could get 78 as value.

thanks in advance!
--
sisco98




Bob Phillips[_7_]

Last row as value
 
Either

Range("A2"),End(xlDown).Row

if there are no blanks in the data, otherwise

Cells(Rows.Count,"A").End(xlUp).Row

--
HTH

Bob Phillips

"sisco98" wrote in message
...
Hi all,

Is there a way to get the last used cell's row number as value? For

example,
if the last used cell is in the 78th row, I could get 78 as value.

thanks in advance!
--
sisco98




sisco98

Last row as value
 
thanks for both tips!
--
sisco98


"Bob Phillips" wrote:

Either

Range("A2"),End(xlDown).Row

if there are no blanks in the data, otherwise

Cells(Rows.Count,"A").End(xlUp).Row

--
HTH

Bob Phillips

"sisco98" wrote in message
...
Hi all,

Is there a way to get the last used cell's row number as value? For

example,
if the last used cell is in the 78th row, I could get 78 as value.

thanks in advance!
--
sisco98






All times are GMT +1. The time now is 06:25 AM.

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