Loop thru filter criteria and save to a new workbook

  • Hi Experts


    I really need your help for the following situation.


    " Row 1 - 4 is the titles. Column Y has multiple different criteria.


    What I want to do is: 1. Filter column Y to see the first criteria. 2. Copy from row 1 to the last used row, and column A-X. 3. Save it as a new workbook. Name it exactly like column Y criteria. I have the File path on Sheets("Detail").Range("D17"). (Cell D17 has a path like this: C:\Users\Aiden\Desktop.......................) 4. Close the new workbook 5. Go back to the main file. filter column Y for next criteria. 6. Copy..save as new workbook....keep going until we loop thru all criteria on column Y.


    Can someone please help me with this?

  • Hello and Welcome to the Forum :wink:


    From your explanation, it seems to me the very ... very first step is to create a UNIQUE list of your data located in Column Y ...


    Would you agree ?


    Rather strange to read your Titles are spread over 4 rows ...!!! why ???

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Hi Carim


    Thank you for your time to read this!!!
    Yes I have a tab like this:


    First 3 column below is like column A-X. Column Y is the criteria column [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 64"]ID[/TD]
    [TD="width: 64"]Date[/TD]
    [TD="width: 64"]expenses[/TD]
    [TD="width: 64"]criteria column[/TD]

    [/tr]


    [tr]


    [td]

    11452

    [/td]


    [td]

    7/7/2019

    [/td]


    [td]

    $10

    [/td]


    [td]

    Tom

    [/td]


    [/tr]


    [tr]


    [td]

    11452

    [/td]


    [td]

    7/14/2019

    [/td]


    [td]

    $12

    [/td]


    [td]

    Tom

    [/td]


    [/tr]


    [tr]


    [td]

    11222

    [/td]


    [td]

    7/1/2019

    [/td]


    [td]

    $11.9

    [/td]


    [td]

    Aiden

    [/td]


    [/tr]


    [tr]


    [td]

    11666

    [/td]


    [td]

    6/1/2018

    [/td]


    [td]

    $203

    [/td]


    [td]

    Tony

    [/td]


    [/tr]


    [/TABLE]

    First filter. Copy column A-X and save as a new workbook with the file name "Tom" [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 64"]ID[/TD]
    [TD="width: 64"]Date[/TD]
    [TD="width: 64"]expenses[/TD]
    [TD="width: 64"]criteria column[/TD]

    [/tr]


    [tr]


    [td]

    11452

    [/td]


    [td]

    7/7/2019

    [/td]


    [td]

    $10

    [/td]


    [td]

    Tom

    [/td]


    [/tr]


    [tr]


    [td]

    11452

    [/td]


    [td]

    7/14/2019

    [/td]


    [td]

    $12

    [/td]


    [td]

    Tom

    [/td]


    [/tr]


    [/TABLE]

    Second filter. Copy column A-X and save as a new workbook with the file name"Aiden"
    [TABLE="border: 0, cellpadding: 0, cellspacing: 0"]

    [tr]


    [TD="width: 64"]ID[/TD]
    [TD="width: 64"]Date[/TD]
    [TD="width: 64"]expenses[/TD]
    [TD="width: 64"]criteria column[/TD]

    [/tr]


    [tr]


    [td]

    11222

    [/td]


    [td]

    7/1/2019

    [/td]


    [td]

    $11.9

    [/td]


    [td]

    Aiden

    [/td]


    [/tr]


    [/TABLE]

    Keep doing it until we loop thru all criteria in column Y.


    For the first 4 row. I know it sounds super weird.
    But I wont be able to import the file without the first 4 rows.


    :(