+ Reply to Thread
Results 1 to 4 of 4

Need help with Custom Sort macros

  1. #1
    Registered User
    Join Date
    12-11-2018
    Location
    New Mexico
    MS-Off Ver
    2016
    Posts
    3

    Need help with Custom Sort macros

    Hi there,

    I'm new here, and know next to nothing about VBA. My workplace, a military fire department, uses an Excel workbook for our annual shift schedule. The workbook is divided into 26 worksheets, one for each pay period in the year, and our personnel roster includes fields (columns) for Name, Duty Position, Location, and Shift Rotation. My goal is to put several buttons on each worksheet that will allow a user to sort the roster by any of those four categories. Three of them are a simple A-Z sort, but for Location sorting I need to sort by Location, then by Position, then by Name. This is the default sorting.

    I've tried a numer of different VBA code solutions that I've found, but I can't seem to tailor them to my needs. Recording a macro for each button hasn't worked either, and I don't know why (but I think it's because when I run the macro on another sheet, the macro only affects the first sheet--not sure).

    Additionally, the worksheets are designed to be printed out and contain a lot of info about staffing levels each day. I've attached a screenshot (names removed).

    Can anyone walk me through this?


    Many thanks,

    -Kevin

    [Edit: Workbook sample is attached now, screenshot removed]
    Attached Files Attached Files
    Last edited by Metorks; 12-11-2018 at 06:10 PM. Reason: Added workbook attachment

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Need help with Custom Sort macros

    Hello Metorks,

    Welcome to the forum!

    It would be a huge help if you could post the workbook. There is a lot of formatting that can effect how the code should be written.

    Since you are new, I don't think you can post a workbook yet. You can either email me a copy and I will post it or you can upload it to a public file share and post the link.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    12-11-2018
    Location
    New Mexico
    MS-Off Ver
    2016
    Posts
    3

    Post Re: Need help with Custom Sort macros

    (Got it. Attached in original post.)
    Last edited by Metorks; 12-11-2018 at 06:10 PM.

  4. #4
    Registered User
    Join Date
    12-11-2018
    Location
    New Mexico
    MS-Off Ver
    2016
    Posts
    3

    Re: Need help with Custom Sort macros

    [deleted to reduce thread clutter]
    Last edited by Metorks; 12-11-2018 at 06:11 PM.

+ 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] Sort only by days, not from days - months - years (custom vba date sort)
    By alexgoaga in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-16-2018, 06:56 AM
  2. Using custom sort orders with Range().sort
    By WestWindsDemon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-21-2018, 03:52 PM
  3. [SOLVED] VBA to custom sort on custom list
    By GregStewartPTC in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2018, 12:54 PM
  4. [SOLVED] Custom sort without custom list
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 01-12-2016, 02:10 PM
  5. Using custom sort with macros
    By metalloidica in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-21-2015, 10:46 AM
  6. Challenged: ascending sort within custom sort
    By jhren in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2013, 12:35 PM
  7. Excel sort by Fill Color by custom list sort
    By Dash4Cash in forum Excel General
    Replies: 2
    Last Post: 07-29-2005, 06:05 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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1