ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to get last row used in sheet DATA (https://www.excelbanter.com/excel-programming/296261-how-get-last-row-used-sheet-data.html)

alainB[_12_]

How to get last row used in sheet DATA
 
Hi,

Just saw this code a few hours ago but can't find it back

The code will tell me that there is that many row used in the sheet
From that info, I will be able to put my next line of data.

Thanks

Alai

--
Message posted from http://www.ExcelForum.com


Rob van Gelder[_4_]

How to get last row used in sheet DATA
 
THere is a last row example on my website

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"alainB " wrote in message
...
Hi,

Just saw this code a few hours ago but can't find it back

The code will tell me that there is that many row used in the sheet.
From that info, I will be able to put my next line of data.

Thanks

Alain


---
Message posted from http://www.ExcelForum.com/




alainB[_13_]

How to get last row used in sheet DATA
 
Hi,

It is not what I saw.

Was very simple, maybe less than 30 letters. I think it is to give th
number of rows used in the sheet.

Thanks

Alai

--
Message posted from http://www.ExcelForum.com


Frank Kabel

How to get last row used in sheet DATA
 
Hi
maybe try
msgbox activesheet.usedrange.rows

-----Original Message-----
Hi,

It is not what I saw.

Was very simple, maybe less than 30 letters. I think it

is to give the
number of rows used in the sheet.

Thanks

Alain


---
Message posted from http://www.ExcelForum.com/

.


Rob van Gelder[_4_]

How to get last row used in sheet DATA
 
UsedRange is alright, as long as you know it's not always going to be the
"real" last row until you've saved.

Alain, maybe it's:
lngLastRow = ActiveSheet.Range("A65536").End(xlUp).Row
That determines the last row based on the last entry in column A


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Frank Kabel" wrote in message
...
Hi
maybe try
msgbox activesheet.usedrange.rows

-----Original Message-----
Hi,

It is not what I saw.

Was very simple, maybe less than 30 letters. I think it

is to give the
number of rows used in the sheet.

Thanks

Alain


---
Message posted from http://www.ExcelForum.com/

.




alainB[_14_]

How to get last row used in sheet DATA
 
Hi,

Thanks.

Almost that Frank!

x= Sheets("DATA").UsedRange.Rows.Count
Msgbox x

It gives me what I need.

Thanks everybody.

Alai

--
Message posted from http://www.ExcelForum.com


SidBord

How to get last row used in sheet DATA
 
Perhaps you could use a variation of one of these:
=Offset(A1,CountA(A:A)-1,0)
OR my personal favorite:
Selection.End(xlDown).Select
This finds the last non-empty cell.
-----Original Message-----
Hi,

Just saw this code a few hours ago but can't find it back

The code will tell me that there is that many row used in

the sheet.
From that info, I will be able to put my next line of data.

Thanks

Alain


---
Message posted from http://www.ExcelForum.com/

.



All times are GMT +1. The time now is 12:07 PM.

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