+ Reply to Thread
Results 1 to 4 of 4

Auto Sort Column on Opening Workbook

  1. #1
    Registered User
    Join Date
    10-10-2019
    Location
    UK
    MS-Off Ver
    2013
    Posts
    15

    Auto Sort Column on Opening Workbook

    Hello to whoever is reading.

    I have just sorted a column on a worksheet, but when changing some data and saving, then re-opening it hasn't sorted the updaed values.


    Each cell in column 'B' will have either 2 types of values in which will change every few weeks:
    1: A date
    2: the word "Completed".


    I want column 'B' to auto sort itself when openening in the following order: oldest date, newest date, completed. ** For your information: Also column 'B' will be a locked column and the sheet protected. It contains a formula & the values will be auto update based on information from other cells **


    I have attached the workbook. Thank you in advance.
    Last edited by TheNerdyGeek; 10-27-2019 at 03:06 PM.

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Auto Sort Column on Opening Workbook

    Possibly with some VBA...
    Please Login or Register  to view this content.
    Copy the code to the "Membership Plans" worksheet module (right click on the sheet's tab and select View Code) and save the workbook. Afterwards, the sort happens whenever the worksheet is activated.

  3. #3
    Registered User
    Join Date
    10-10-2019
    Location
    UK
    MS-Off Ver
    2013
    Posts
    15

    Re: Auto Sort Column on Opening Workbook

    Hi dandelor, that works well, thank you.

    Is there any way of either:
    1: auto sorting upon opening
    2: having a button at the top which will sort when clicked.

    Most pf the people using it will forget to swap tabs and will not get sorted.

  4. #4
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,274

    Re: Auto Sort Column on Opening Workbook

    Place this code in a standard code module
    Please Login or Register  to view this content.
    Place this code in the ThisWorkbook code module
    Please Login or Register  to view this content.
    If you create a button, assign it the SortColumnB macro.
    Last edited by dangelor; 10-29-2019 at 06:52 PM. Reason: Changed worksheet name

+ 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. Prevent Auto Calculation On Opening a Workbook
    By Excel-Access in forum Excel General
    Replies: 1
    Last Post: 09-30-2015, 08:05 AM
  2. [SOLVED] VBA to auto update when opening a workbook
    By namluke in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-27-2014, 04:28 PM
  3. Replies: 3
    Last Post: 07-17-2013, 01:25 AM
  4. Auto-close workbook after opening another workbook
    By natefarm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-21-2011, 04:32 PM
  5. Problem wih sort code on opening workbook
    By BobTheRocker in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-05-2010, 05:15 AM
  6. Auto sort columns on opening
    By wereman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-06-2008, 09:08 AM
  7. Auto macro opening excel workbook
    By Baris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2005, 08:05 AM

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1