Consulting

Results 1 to 3 of 3

Thread: Macro for sorting by lot number, splitting table w/new header, then sort by due date

  1. #1

    Macro for sorting by lot number, splitting table w/new header, then sort by due date

    Our database yields us a large Excel table with two important pieces of information: Affected Lot and due date. I need a macro that can first sort by lot number, then split the table into numerous tables, one for each similar lot number, with a new header applied. See below for example:

    From this:

    Due Date Deviation Number Affected Lot
    14-Nov-2019 1 A
    23-Nov-2019 2 C
    01-Dec-2019 3 B
    14-Nov-2019 4 A
    15-Dec-2019 5 D

    To this:


    Due Date Deviation Number Affected Lot
    14-Nov-2019 1 A
    14-Nov-2019 4 A

    Due Date Deviation Number Affected Lot
    23-Nov-2019 2 C

    Due Date Deviation Number Affected Lot
    01-Dec-2019 3 B

    Due Date Deviation Number Affected Lot
    15-Dec-2019 5 D

    My attempt at word VBA has shown me I don't know enough to know how little I truly know () so any help would be greatly appreciated.

    Thank you

  2. #2
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,645
    A sample workbook likewise.

  3. #3
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,874
    A sample workbook would prevent a lot of incorrect guesswork from us.
    In the attached, 2 sheets, one with a table (a proper Excel Table (listobject)) and one without. Buttons calling a variation of the same macro.
    Attached Files Attached Files
    p45cal
    Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •