determine last row in any worksheet

M

mackie

anybody can help me how to determine which is the last row
or how to move the cell pointer to last row (not empty) of
the worksheet?

- i am getting lots of worksheets and i'd like to
determine right away the last row (not empty)

thanks a lot
 
J

Jason Morin

You can type A65536 in the namebox and then do Ctrl+Up
Arrow.

HTH
Jason
Atlanta, GA
 
M

mackie

thanks jason..
actually what i really want to do is..
lets say i received a worksheet with
1) rows up to 10
2) rows up to 100

i would like to create a macro that will position my cell
pointer to worksheets samples

1) A11
2) A101

thanks again
 
L

Llobid

Mackie...

Pressing Ctrl...End will place the cursor at the last active cell i
any worksheet, then pressing Home will take you to the beginning cel
of that row. You should be able to create a macro that will do that, i
you think it is necessary
 
F

firefytr

hello mackie,

to call it from a routine, you could adapt the following...


Code
-------------------
Sub getAddy()

Set LastRow = Range("A65536").End(xlUp)
MsgBox LastRow.Address() & " is the last cell in column A" & vbCrLf _
& "with data."

End Su
 
T

Toby Erkson

Man this topic comes up a lot!

Here's something I use:
Sheets("sheet_name_goes_here").Select ' Go to the sheet you want to check
MaxRowz = Range("A65536").End(xlUp).Row 'Start at the bottom and work up
to the first non-empty row

Now, MaxRowz will return the row number of the last POPULATED row. To get the
row BELOW it (the empty one) simply add the number one to is i.e. MaxRowz =
MaxRowz + 1
 

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