+ Reply to Thread
Results 1 to 7 of 7

Select last row and then...

  1. #1
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Select last row and then...

    Hello,

    Could anyone please help me with my problem.

    I just want to:


    1. Select the last row of Column B
    2. After selecting it, then CTRL A ( select all ) and then move 1 row for the header is not included.

    Highlighted rows should be selected.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    12-19-2012
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    135

    Re: Select last row and then...

    Hi,

    Not sure what you need here, can you try to explain a little more please?

    Regards
    Steve

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Select last row and then...

    Try this Sheet1 vba code
    Please Login or Register  to view this content.
    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Select last row and then...

    Hello Steve,

    I just want to select A1-J, but since some rows in Column A have no data (when i 'ctrl-a' some data in column a is not captured), i have to go to in Column B due to all rows of it have a data, then 'ctrl a' to select all but not including the header. Sorry for my bad english.

  5. #5
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Select last row and then...

    Hi Ron,

    That's what i need!

    Could you please explain the code per line?

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Select last row and then...

    Regarding this code:
    Please Login or Register  to view this content.
    Since I refer to the CurrentRegion several times, I constructed a With/End With section so I could refer to it with a period.
    Please Login or Register  to view this content.
    That means the CurrentRegion that includes cell A1

    In this section:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    means: CurrentRegion.Rows.Count
    Please Login or Register  to view this content.
    means: CurrentRegion.Columns.Count

    and this:
    Please Login or Register  to view this content.
    refers to the bottom right corner of the CurrentRegion

    This section:
    Please Login or Register  to view this content.
    refers to the range with A2 in the upper left and the bottom right corner of the CurrentRegion

    I hope that helps.

  7. #7
    Forum Contributor
    Join Date
    04-23-2013
    Location
    India
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    227

    Re: Select last row and then...

    Thanks Ron! it helps a lot!

+ 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. [SOLVED] Select Case - End select issue
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-31-2013, 02:07 PM
  2. Replies: 4
    Last Post: 06-17-2013, 05:21 AM
  3. Code to prevent user to Select COLUMNS but allow to select ROWS
    By tengrosita in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2011, 03:46 AM
  4. Replies: 1
    Last Post: 04-23-2007, 04:23 PM
  5. Replies: 1
    Last Post: 03-04-2005, 08:06 PM

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