+ Reply to Thread
Results 1 to 3 of 3

VBA Sorting

  1. #1
    Registered User
    Join Date
    04-07-2019
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    14

    VBA Sorting

    Hi all.

    I have table which specifies the repair, the sequence (aka the priority) and the workstation as shown below.
    Is there anyway a VBA code will be able to help me sort the repairs in order, by grouping repairs done at the same workstation together, while maintaining the sequence within the repair itself.

    The first table shows the before and the second table shows the possible result.

    The logic should be somewhere along the line of:
    1. Using the repair with lesser processes as the reference , in this case, the repair highlighted in green.

    2. Taking the first repairstation scheduled for that particular object as a reference, do a loop down to find in the other object repair (highlighted in yellow) if there is any repairs to be done at the same station.

    3. If answer is yes for 2.,cut whatever that above the particular row which consists of the similar workstation and paste it above the reference repair (green) which was used as a reference in 2..

    4. Continue loop and move of to the second unique workstation found in object A (green) and repeat steps 2 and 3 until all unique workstations have been accounted for.

    There is a possibility to have more than 2 objects as well.

    Will really appreciate any contribution of help.
    Have been troubled by this for many many days.

    Untitled.jpg
    Attached Files Attached Files

  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: VBA Sorting

    Hello ElvinK,

    I follow you logic for the first 2 objects, but the third appears to be inconsistent. Shouldn't Repair 03 for Object A Room C be below Repair 02 for Object B Room C?
    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
    04-07-2019
    Location
    Montreal
    MS-Off Ver
    2010
    Posts
    14

    Re: VBA Sorting

    HI Leith Ross,

    Repair 03 for Object A Room C cannot be below Repair 02 for Object B Room C. All repair for any particular object must obey the "Priority", specified in the second column.

+ 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] 3-level sorting including sorting a column by the number of percent sign in each cell
    By terryhenderson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2017, 05:21 PM
  2. Replies: 1
    Last Post: 12-16-2015, 01:04 PM
  3. [SOLVED] I require sorting formula in excel sheet with complex sorting.
    By kaminanirav in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-24-2015, 08:16 AM
  4. Replies: 0
    Last Post: 02-24-2014, 11:27 AM
  5. Sorting 2 data ranges by comparing one column in each and sorting to match
    By MDKsmiffy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-17-2013, 03:30 PM
  6. Sorting a range to invert it upside down without sorting by any specific column
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2013, 12:53 PM
  7. [SOLVED] Sorting a range to invert it upside down without sorting by any specific column
    By luv2glyd in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-28-2013, 12:43 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