+ Reply to Thread
Results 1 to 12 of 12

Is there a way to automate this row sort process?

  1. #1
    Registered User
    Join Date
    11-14-2019
    Location
    Nutsville, Oregon
    MS-Off Ver
    2007
    Posts
    13

    Is there a way to automate this row sort process?

    Attached is a small section of a 7-column, 95-row database.
    I want to sort each row from low to high.
    I've done this with the first row of the sample.
    Is there a way to automate this process with a formula?
    Ive tried selecting the whole table and doing a regular sort but it only works on one or two rows.
    Advice would be much appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor vba_php's Avatar
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    1,227

    Re: Is there a way to automate this row sort process?

    Your post leads me to believe that you're actually desiring to sort by the column from left to right. But if you're actually wanting to sort by the row which is exactly what the built-in feature of excel offers through the sorting menu in the interface, then all you have to do is click the buttons to do that task. So are you wanting to sort the data in the table by way of left to right or right to left or do you want to sort it by a vertical nature which is what Excel offers through its menu options? Keep in mind I'm on a phone at the moment so I can't download your file and look at it
    -Adam (please don't call me "sir"!)

  3. #3
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,314

    Re: Is there a way to automate this row sort process?

    Hi

    Try this VBA code.
    Please Login or Register  to view this content.
    See the file
    Attached Files Attached Files

  4. #4
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,314

    Re: Is there a way to automate this row sort process?

    Hi

    With a formula in J3 and drag down and across
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-14-2019
    Location
    Nutsville, Oregon
    MS-Off Ver
    2007
    Posts
    13

    Re: Is there a way to automate this row sort process?

    vba-php, hi. Yes, I want to sort each row from left to right, as I've already done with the top (bolded) row.
    But I regularly have 95 rows to sort and it's too time-consuming to do them one at a time with the regular sort process in my Excel 2007.
    No, not vertical, I want to sort the rows. Horizontally.

    Jose Augusto: Thanks for the suggestions.
    The VBA looks interesting but I'm at work and won't be able to try it until I get home.
    But I did try the formula and it didn't work. I've attached the result here. Maybe I didn't apply it properly?
    Attached Files Attached Files

  6. #6
    Valued Forum Contributor vba_php's Avatar
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    1,227

    Re: Is there a way to automate this row sort process?

    If Jose is solution doesn't work for you I can't think of any other way to do it other than to loot in code sorry. At first I thought of the transpose function but all that does is take a range block of text and cells and turns at 90°.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    2007, Office 365
    Posts
    11,608

    Re: Is there a way to automate this row sort process?

    Quote Originally Posted by excelamer View Post
    Jose Augusto: Thanks for the suggestions.
    The VBA looks interesting but I'm at work and won't be able to try it until I get home.
    But I did try the formula and it didn't work. I've attached the result here. Maybe I didn't apply it properly?
    That is likely because AGGREGATE was introduced in Excel 2010. Your profile shows 2007.

    Try instead in J3:P12
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Dave

  8. #8
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,314

    Re: Is there a way to automate this row sort process?

    That is likely because AGGREGATE was introduced in Excel 2010. Your profile shows 2007.
    Thank you Dave.
    My fault. I don't see the profile.

  9. #9
    Forum Expert
    Join Date
    07-20-2011
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    4,982

    Re: Is there a way to automate this row sort process?

    In J3 then copied across and down.

    =SMALL($B3:$H3,COLUMNS($J3:J3))
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  10. #10
    Registered User
    Join Date
    11-14-2019
    Location
    Nutsville, Oregon
    MS-Off Ver
    2007
    Posts
    13

    Re: Is there a way to automate this row sort process?

    FlameRetired:
    kvsrinivasamurthy:
    Guys, thanks for your inputs. However, I have the same problem with both formulas - I don't understand how to apply either of them to my 90-something row database. As I said in my first post, the original file\table I supplied was just a small sample of the whole.

  11. #11
    Forum Expert
    Join Date
    07-20-2011
    Location
    mysore
    MS-Off Ver
    Excel 2007
    Posts
    4,982

    Re: Is there a way to automate this row sort process?

    Just copy down all formulas upto the rows required. If still problem persists upload the file.

  12. #12
    Registered User
    Join Date
    11-14-2019
    Location
    Nutsville, Oregon
    MS-Off Ver
    2007
    Posts
    13

    Re: Is there a way to automate this row sort process?

    "Just copy down all formulas upto the rows required"

    Sorry, I have no idea what you're saying. No worries, I'll look elsewhere.

+ 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. Automate Login process
    By blue.chio in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-15-2012, 07:48 AM
  2. How to automate all process?
    By janernevis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-01-2010, 03:05 PM
  3. Automate process
    By kamalthakur in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2010, 11:27 AM
  4. Automate a add-in process
    By The Excel Boy in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2008, 01:26 AM
  5. automate process
    By Aurbo99 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-08-2007, 05:46 PM
  6. Automate process
    By martins in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-27-2007, 02:39 PM
  7. Automate an Excel process
    By msnate in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2006, 11:00 PM

Tags for this Thread

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