+ Reply to Thread
Results 1 to 3 of 3

Range(Selection...question

  1. #1
    Forum Contributor
    Join Date
    11-17-2004
    MS-Off Ver
    Office 2016
    Posts
    527

    Range(Selection...question

    This may not actually be a macro question but the solution will affect the work I need to do in a marco.

    I have a worksheet of addresses where selection keystrokes (Ctrl+Shift+Right Arrow) as well as macro code such as "Range(Selection, Selection.End(xlToRight)).Select" work on the header row but these selection techniques don't work on the actual address rows.

    The way I use either method is I place the cursor on data in the first row and either use C+S+R or execute a macro using a keyboard shortcut assigned to that marco. Either way, the only data that gets selected is the next row to the right, not the entire row of data. Both methods work fine in the header row only.

  2. #2
    Tom Ogilvy
    Guest

    Re: Range(Selection...question

    that action selects to but not including the next empty cell if the first
    cell to the right and the active cell are not empty.

    range(cells(1,Activecell.Column),cells(1,ActiveCell.column).End(xltoRight)).
    Offset(ActiveCell.row-1,0).Select

    might do what you want.
    --
    Regards,
    Tom Ogilvy

    "JimDandy" <[email protected]> wrote in
    message news:[email protected]...
    >
    > This may not actually be a macro question but the solution will affect
    > the work I need to do in a marco.
    >
    > I have a worksheet of addresses where selection keystrokes
    > (Ctrl+Shift+Right Arrow) as well as macro code such as
    > "Range(Selection, Selection.End(xlToRight)).Select" work on the header
    > row but these selection techniques don't work on the actual address
    > rows.
    >
    > The way I use either method is I place the cursor on data in the first
    > row and either use C+S+R or execute a macro using a keyboard shortcut
    > assigned to that marco. Either way, the only data that gets selected is
    > the next row to the right, not the entire row of data. Both methods work
    > fine in the header row only.
    >
    >
    > --
    > JimDandy
    > ------------------------------------------------------------------------
    > JimDandy's Profile:

    http://www.excelforum.com/member.php...o&userid=16578
    > View this thread: http://www.excelforum.com/showthread...hreadid=397279
    >




  3. #3
    Forum Contributor
    Join Date
    11-17-2004
    MS-Off Ver
    Office 2016
    Posts
    527
    Thanks! That was it, I really appreciate your help.

+ 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