+ Reply to Thread
Results 1 to 3 of 3

How do you select the range next to your selected range?

  1. #1
    Forum Contributor
    Join Date
    04-01-2010
    Location
    USA
    MS-Off Ver
    Office 2021
    Posts
    185

    How do you select the range next to your selected range?

    I have 1 column with labels and no empty cells. The column next to it has numbers, but there are empty cells throughout the column. This pattern continues for a few times with an empty column between the numbers from 1 group and the labels for the next.

    I have the following code to copy and paste the data from 1 sheet into another.

    Please Login or Register  to view this content.
    The problem is I can only copy the labels column. The ".end(xlDown)" doesn't work because of the empty rows. If I select the labels column and then hold down shift and push the right arrow it selects the numbers column. How can I do this very simple thing in VBA?

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: How do you select the range next to your selected range?

    Try coming from the bottom up rather than the top down. Also using resize will help:

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How do you select the range next to your selected range?

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ 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. Select a Range of Cells Offset from a Selected Merged cell
    By kelvomatic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-07-2013, 05:52 PM
  2. send to range, popup box to input what the range should be each time/select range
    By lax2734 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-26-2012, 01:37 AM
  3. How to select the last cell in a currently selected range
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-20-2011, 05:09 PM
  4. Replies: 1
    Last Post: 05-15-2006, 04:10 AM
  5. Compare a selected Range with a Named range and select cells that do not exist
    By PCLIVE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-18-2005, 03:05 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