Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default Obtain Row No of xlEnd

Good stuff, but is there an Object that is the currently active
worksheet, so that I don't have to know the explicit name of the
current workbook (which would break if the file were renamed)?

ActiveWorksheet.

does not seem to work.

Sub A1_Test()
MsgBox AciveWorksheet.Cells.SpecialCells(xlCellTypeLastCe ll).Row
End Sub

bombs.

And I presume that it would bomb with your code for the last cell in
Column A.

On Thu, 11 Jun 2009 17:54:26 -0500, Dave Peterson
wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtain User ID AL Excel Programming 4 March 27th 09 06:07 AM
How To Obtain The Top 10% SMH Excel Discussion (Misc queries) 4 March 26th 08 01:09 PM
anyone ever hear of a formula beginning "xlend"? excelmix Excel Discussion (Misc queries) 3 September 11th 06 02:00 PM
xlend syntax in VBA-guru help needed Stuart Farr[_5_] Excel Programming 3 May 3rd 04 03:47 PM
Need to know how to obtain this...please 0o0o0[_9_] Excel Programming 2 October 18th 03 04:28 PM


All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"