Obtain Row No of xlEnd

F

Fred Holmes

Excel 2000

I need proper syntax for a statement like:

While ActiveCell.Row < xlEnd.Row

How do I obtain the Row number of the end of the active work area in a
worksheet? The same cell as the cell selected by Ctrl-End.

TIA

Fred Holmes
 
D

Dave Peterson

Dim LastRow as long
with worksheets("somesheetnamehere")
lastrow = .cells.specialcells(xlcelltypelastcell).row
end with

But excel remembers too much. It'll keep track of that last used cell even if
I've cleared it.

I like to pick out a column that always has data in it if that row is used.

Dim LastRow as long
with worksheets("somesheetnamehere")
lastrow = .cells(.rows.count,"A").end(xlup).row
end with

I used column A in this sample.
 

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