+ Reply to Thread
Results 1 to 4 of 4

Can I have a column of cells always automatically Sort by Date - Oldest to Newest?

  1. #1
    Registered User
    Join Date
    03-18-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    78

    Question Can I have a column of cells always automatically Sort by Date - Oldest to Newest?

    I have one column on a spreadsheet that I would like to always have sorted by date newest to oldest (Q8:Q15000) whenever a filter is applied in any of the columns.


    ((only read this section if you want to know the root of the problem)))
    The problem that I have and I don't think there is another answer for is that the sheet has certain columns that contain "link" formulas (example: =IF(I9>0,HYPERLINK(I9, "Link"),"") and it has to be sorted AND protected from people clicking in the cell. Problem is that if I use the uncheck "select locked calls" option when locking the sheet and use allow users to edit range, then no one can click in the cell when it turns into a hyperlink. So there is no way to lock this cell down and still be able to sort AND click in the cell because Excel has a known issue with this. And I had to use that link formula in that cell becuase if you don't do it that way then you SORT, then SORT another column by something all of your links get screwed up. This is a problem that is known and listed on Microsoft web site. That's the background.




    Also the entire sheet is password protected. So whatever VBA is used it would have to be able to force the sheet to always sort a locked sheet (password is 78951). Again the trigger to sort like this would be whenever anyone applies a filter on any of the other columns.
    Column headers are in row 7.
    The sheet is A-X in number of columns, Q is the one that has the date. The sheet is 15,000 rows.

    Thanks for any help.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Can I have a column of cells always automatically Sort by Date - Oldest to Newest?

    What about loading the spreadsheet to Power Query. Sorting in Power Query and then Close and Load back to your workbook. Any changes made to the original data will be updated correctly in the data output sheet from PQ whenever the workbook is opened if you set the connection to refresh on open.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    03-18-2015
    Location
    Detroit
    MS-Off Ver
    2013
    Posts
    78

    Re: Can I have a column of cells always automatically Sort by Date - Oldest to Newest?

    Thanks for looking. I think that would be too complicated for the shop floor employees to use.
    However if you wouldn't mind looking I created a macro with a button that just unlocks, sorts by that column then re-locks the sheet.

    Problem is that it doesn't assign another lock password or ask for the original except the first time only, (due to not locking it with a password).


    Not sure how to go about it, here is the code.

    Please Login or Register  to view this content.
    thanks again

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,806

    Re: Can I have a column of cells always automatically Sort by Date - Oldest to Newest?

    Thanks for looking. I think that would be too complicated for the shop floor employees to use.
    I think your shop floor employees would be capable of using it. Alan said this:

    Any changes made to the original data will be updated correctly in the data output sheet from PQ whenever the workbook is opened if you set the connection to refresh on open.
    They wouldn't have to even know about the query working in tha background.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them 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. [SOLVED] Grouping cell with blank cells below and sort by date oldest to newest
    By Lucille Boshoff in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-14-2017, 10:28 AM
  2. Can't sort by newest to oldest if I have more blank cells than dates in a column
    By icordeiro in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-19-2017, 06:28 PM
  3. Replies: 3
    Last Post: 01-18-2017, 02:02 PM
  4. Replies: 2
    Last Post: 01-18-2017, 01:55 PM
  5. Replies: 1
    Last Post: 09-01-2016, 08:01 AM
  6. [SOLVED] Sort dates in column from oldest to newest...
    By ILoveYouExcel in forum Excel General
    Replies: 2
    Last Post: 06-11-2014, 02:11 PM
  7. [SOLVED] VBA to sort columns left to right - oldest to newest
    By kenadams378 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-17-2013, 10:36 AM

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