+ Reply to Thread
Results 1 to 3 of 3

Select area between two bottom rows

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Select area between two bottom rows

    I have data in Column A, and in Column B. I want to select the area from the bottom of column A to the bottom of column B (really, I want to delete that area). Here's the code I'm trying to use:
    Firstrow = Range("A" & Rows.Count).End(xlUp).Row
        LastRow = Range("B" & Rows.Count).End(xlUp).Row
        Range(Firstrow:LastRow).Select
    The last line has a syntax error, but I dont know how to resolve the syntax. Can someone help?
    Last edited by jomili; 05-12-2011 at 08:59 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,739

    Re: Select area between two bottom rows

    Is this what you're looking for:

    Firstrow = Range("A" & Rows.Count).End(xlUp).Row
    LastRow = Range("B" & Rows.Count).End(xlUp).Row
    Range(Firstrow & ":" & LastRow).Select

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Re: Select area between two bottom rows

    Thanks TMShucks; that was 99.9% of what I needed. I just had to add an offset to my Firstrow line. See code below:

    Firstrow = Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row
    LastRow = Range("B" & Rows.Count).End(xlUp).Row
    Range(Firstrow & ":" & LastRow).Select
    Syntax seems to be my biggest issue, so I'm very grateful to folks like you who step in and help out. God bless you!

    Thanks,
    John

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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