+ Reply to Thread
Results 1 to 8 of 8

Sort unknown number of columns by row 1

  1. #1
    Registered User
    Join Date
    05-26-2011
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    11

    Sort unknown number of columns by row 1

    Hello,

    Just getting going on programming in Excel and could use some help. Searched many places but have not found anything that works. I have worksheet that copies and pastes data from another worksheet into mine in row 2. I never know how many columns there will be.
    I need to find the number of columns and then sort by row one (Start at F1) in descending order. (basically flip the order)

    Text Text Text Text Text 1 2 3 4 5 6 7 8 9 10 11 12 13
    1 2 3 4 5 6 7 8 9 10
    1 2 3 4 5 6 7 8 9 10
    1 2 3 4 5 6 7 8 9 10
    Any ideas?

    Thanks.
    Last edited by rwqiii; 05-31-2011 at 08:02 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Sort unknown number of columns by row 1

    hi, rwqiii, can you post sample workbook showing original data and the result you need to obtain?

  3. #3
    Registered User
    Join Date
    05-26-2011
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort unknown number of columns by row 1

    That's what I was trying to show in the original post but didn't work too well. I've attached a test file that just has the before and after the same sheet. This one goes to 12 across but that is the unknown in each file. There is no limit to rows.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Sort unknown number of columns by row 1

    please check attachment, run code "test"
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-26-2011
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort unknown number of columns by row 1

    Watersev, that works great however I wasn't clear in my file. Row 1 will have 1 to 100 as an ID. Row 2 is the input data and may only have 10 columns. I always need the data to start in the same column. Sorry I can't attach another example right now, I'm answering from my phone.

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Sort unknown number of columns by row 1

    please post new sample when it will be possible to look at

  7. #7
    Registered User
    Join Date
    05-26-2011
    Location
    Michigan
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort unknown number of columns by row 1

    Watersev, I believe I figured out how to adapt to my last post. I appreciate your help.

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Sort unknown number of columns by row 1

    that's good, if we are done, please mark the thread as Solved (see Forum Rules for instructions)

+ 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