+ Reply to Thread
Results 1 to 6 of 6

Click button to Sort by Alpha, then click button to return Original order

  1. #1
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    328

    Click button to Sort by Alpha, then click button to return Original order

    A few years ago I managed to get a sort button at the top of a column to sort the numbers in the column
    by 'ascending' with the first button click, and then 'descending' with the second button click.

    Now I have a slightly trickier situation.

    I have 120 names in a particular order in column A.
    I need to somehow lock that order in. Call it Order1.

    I want to make a button to sort column A by ascending names. Call that Order2.

    And so, each time I click the button, it will sort the column, alternating between
    Order1 and Order2.

    This is a little beyond my capabilities.
    Any help is appreciated!

  2. #2
    Forum Contributor
    Join Date
    01-25-2013
    Location
    near Philly, PA USA
    MS-Off Ver
    Excel 2019
    Posts
    178

    Re: Click button to Sort by Alpha, then click button to return Original order

    how about sending a sample workbook?

  3. #3
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    328

    Re: Click button to Sort by Alpha, then click button to return Original order

    Quote Originally Posted by bob33 View Post
    how about sending a sample workbook?
    Sure.
    Here is a sample.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,587

    Re: Click button to Sort by Alpha, then click button to return Original order

    This doesn't involve buttons but perhaps it will help.
    While the names are in original order, number another column 1:120
    Select a cell in the names column and then select sort A to Z
    to get back to the original sort order select a cell in the numbered column and then select sort A to Z.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Forum Contributor
    Join Date
    02-14-2014
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2013
    Posts
    328

    Re: Click button to Sort by Alpha, then click button to return Original order

    Quote Originally Posted by JeteMc View Post
    This doesn't involve buttons but perhaps it will help.
    While the names are in original order, number another column 1:120
    Select a cell in the names column and then select sort A to Z
    to get back to the original sort order select a cell in the numbered column and then select sort A to Z.
    Let us know if you have any questions.
    Thanks for helping out JeteMC!
    That's a pretty cool trick.

    A couple of days ago I thought of two other solutions.
    The first simply was to add another worksheet to the file.
    On that worksheet I copied the column with the 120 names and other associated data.

    When I want to sort by alpha I can do it on this second worksheet, preserving the original
    name order on the first worksheet.

    The other option involves copying the 120 names to another column, out of view on the worksheet.
    Then I can sort the names by alpha, and when I need the original order of names again,
    I would just copy the names back from the column I added.

    It would work because the data to the right of the names all involve formulae, linking to another sheet,
    and the name currently in column A.

    I decided to go with the first option (extra worksheet), so no button/macro is required.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,587

    Re: Click button to Sort by Alpha, then click button to return Original order

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Replies: 2
    Last Post: 01-09-2018, 11:39 AM
  2. Replies: 1
    Last Post: 02-27-2017, 09:17 AM
  3. [SOLVED] make button single click to avoid user double click
    By Muzza1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2016, 01:02 AM
  4. Button Click on Spreadsheet commanded by Button Click on Userform
    By Quilie19 in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 04-07-2015, 11:35 PM
  5. Simple form control Macro to sort row or rows on button click?
    By ElmerFud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2014, 02:06 PM
  6. [SOLVED] click on a color button and after button click it will color entire row of cell you click
    By swade730 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-11-2014, 06:06 PM
  7. [SOLVED] [SOLVED] Create floating button based on button click in menu
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-12-2005, 02: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