+ Reply to Thread
Results 1 to 3 of 3

Nice clean way to Measure/set EOD of worksheet

  1. #1
    Registered User
    Join Date
    03-15-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    37

    Nice clean way to Measure/set EOD of worksheet

    Hello and thank you for time and effort to review this thread.

    This is something that has been bugging me for a long time. I found one of cleanest methods to measure/set the last row (EOD) of a worksheet is
    Please Login or Register  to view this content.
    It reports the last row reliably even if the column includes blank cells above EOD, it will ignore that and report the last 'non-vacant' cell. Other methods report the first occurance of a blank cell.

    The problem is, the syntax is nasty, I would like to report the column numerically instead of using an alpha ('A...'), for example
    Please Login or Register  to view this content.
    This doesn't work but it would be a big improvement.

    Here is an even better example
    Please Login or Register  to view this content.
    This would be the ultimate.

    Is there a way to adapt this to measure the last column, something like this
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Nice clean way to Measure/set EOD of worksheet

    Hello MrHockey,

    This looks like a 2 part question. To get the column number, instead of the letter, you can set a range object equal to the new range determined by the last cell in the column. Here is an example.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Nice clean way to Measure/set EOD of worksheet

    The "standard" method for determing last cell within a specific range is outlined here
    (as outlined in link above use of UsedRange, xlCellTypeLastCell etc are not bullet proof)

    As Leith has illustrated the use of hard wired row references should be replaced by Rows.Count given this will work across all XL versions
    (65536 does not apply to XL2007 etc...)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1