+ Reply to Thread
Results 1 to 8 of 8

How to find the last row in a region

  1. #1
    Registered User
    Join Date
    05-02-2012
    Location
    Richmond, VA
    MS-Off Ver
    Office 2010
    Posts
    15

    How to find the last row in a region

    I know there is an easy way to determine the last row on a worksheet or region, I just don't know what it is. I know how to do it using end(xldown) etc, but this fails sometimes when there is an empty cell or empty row. Can you help. This is for use in a macro.

  2. #2
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: How to find the last row in a region

    I find that coming up from the bottom is easier than down from the top. I use:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: How to find the last row in a region

    Hi.

    See too.
    http://www.rondebruin.nl/win/s9/win005.htm
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  4. #4
    Registered User
    Join Date
    05-02-2012
    Location
    Richmond, VA
    MS-Off Ver
    Office 2010
    Posts
    15

    Re: How to find the last row in a region

    Yes I think coming up from the bottom will work best, thanks.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to find the last row in a region

    Maybe:

    Please Login or Register  to view this content.
    Where A2 is the first cell in the region.

  6. #6
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: How to find the last row in a region

    John H. Davis - Forgive my ignorance, but does that accommodate intermittent blank rows? In my quick test, it seemed to select the last row when column A contained continuous data, but when I infused blanks, it selected the first blank. I found your solution really cool, but assume I'm missing something.
    Thanks for any clarification!

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to find the last row in a region

    Nope. It selects the last row of the current region. That's what I thought we were after. If there are entire blank rows that would separate the current region.

  8. #8
    Forum Contributor JP Romano's Avatar
    Join Date
    10-09-2008
    Location
    Princeton, NJ
    MS-Off Ver
    2010
    Posts
    500

    Re: How to find the last row in a region

    Ah, right... BRILLIANT!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 05-17-2012, 06:30 PM
  2. Replies: 1
    Last Post: 10-04-2007, 12:04 PM
  3. current region = name
    By by1612 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-27-2007, 06:58 PM
  4. sum - region wise
    By sagar in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 11-06-2006, 11:44 AM
  5. Select region
    By Simon Woods in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2006, 11:30 AM

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