Consulting

Results 1 to 4 of 4

Thread: Sort 2 Columns Code Needed

  1. #1
    VBAX Newbie
    Joined
    Jul 2010
    Posts
    5
    Location

    Sort 2 Columns Code Needed

    I have a work sheet that has the inventory for our shoe store, Columns A to X and is sub totaled by each vendor.

    I want to be able to sort Columns H & J which contains the style # and sizing respectfully for each vendor.The problem is each vendor will have x amount of rows to sort depending on how many items they have, and since the subtotals are by vendor, I must do each vendor down the list to keep the sections in tact.

    Please help me with a formula. Thanks.

  2. #2
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Remove the subtotals,
    sort by vendor, style, size,
    put the subtotals back in.
    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.

  3. #3
    VBAX Newbie
    Joined
    Jul 2010
    Posts
    5
    Location
    There are over 400 sub totals. How would I put the subtotals back in the appropriate rows? Thanks for your suggestion.

  4. #4
    Knowledge Base Approver VBAX Wizard p45cal's Avatar
    Joined
    Oct 2005
    Location
    Surrey UK
    Posts
    5,876
    Pre Excel 2007:
    Select the table, drop down menu:
    Data|Subtotals...
    At Each change in Vendor
    Use Function Sum (?)
    Add subtotal to: wherever it was before.
    Click OK.

    in xl 2007 and later:
    Select the table, then on the Data tab of the ribbon, click Subtotals, then the rest is the same as pre xl2007.
    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
  •