How to get last row used in sheet DATA

  • Thread starter Thread starter alainB
  • Start date Start date
A

alainB

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
 
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
 
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
 
Hi,

Thanks.

Almost that Frank!

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

It gives me what I need.

Thanks everybody.

Alai
 
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.
 

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

Back
Top