+ Reply to Thread
Results 1 to 8 of 8

Select to the end of a row based on used column range

  1. #1
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Select to the end of a row based on used column range

    Hello all,

    Do any of you know the code to select all the cells in a random row of data based on the amount of field names in row1?

    Thanks
    BrownBoy

    If happy, mark "SOVLED" & add to "REP"

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Select to the end of a row based on used column range

    You could do a CountA on row 1 and that would tell you how many fields it contained.

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: Select to the end of a row based on used column range

    Thanks xladept,

    To clarify I'm looking for the column equivalent of the following:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-26-2014
    MS-Off Ver
    Excel 2013
    Posts
    31

    Re: Select to the end of a row based on used column range

    Do you mean that you want to select an entire row?
    Please clarify exactly what you want. An example would help too.

  5. #5
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Select to the end of a row based on used column range

    Please Login or Register  to view this content.
    ??

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,527

    Re: Select to the end of a row based on used column range

    Selects in Row 1 from A1 to the last used cell in Row 2
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-06-2013
    Location
    Salt Lake City, Utah
    MS-Off Ver
    2007, 2010
    Posts
    127

    Re: Select to the end of a row based on used column range

    jolivanes and xladept,

    I used the CountA to get what I needed done, but I was looking for what jolivanes posted. Now I have both in my VBA inventory. Thanks.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Select to the end of a row based on used column range

    You're welcome and thanks for the rep!

+ 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 Range In Column Based On Two Different Cells
    By Regular_Joe in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 05-30-2014, 11:47 AM
  2. Range Select Based on Column Header
    By Nospmas in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2013, 11:27 AM
  3. select a column range based on a condition and copy to another sheet
    By GSCCK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2012, 10:59 PM
  4. Select Range based on data in different column
    By Jonathan78 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2012, 09:10 AM
  5. [SOLVED] How to select a range based on values in 1 column
    By ForestRamsey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2005, 12: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