View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Obtain Row No of xlEnd

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.

Fred Holmes wrote:

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


--

Dave Peterson