Use VBA to filter column A of main table on WS1, paste into WS2, repeat 10 times

  • Simplified version: I have one main table with two columns and 100 rows. I want to filter Column 1 against a list of 10 different criteria (one of the following: A, B, C, D, E, F, G, H, I and J), one at time, and place the results in a second worksheet. This is the essence of what I want to do.

    Suppose a main table on Sheet1 has two columns, with Column 1 randomly containing one of the following: A, B, C, D, E, F, G, H, I or J. I want to:

    - Filter Column 1 on criteria 'A', copy the resulting table, and place it into Sheet2.

    - Then, filter Column 1 on 'B', copy the resulting table, and place that below the first table on Sheet2.

    - Similarly, loop through the remaining criteria: C, D, E, F, G, H, I or J, and place the resulting table below the other tables on Sheet2.

    I would really appreciate any pointers to, for example, existing solutions that I could adapt to accomplish this.

    Thank you, Sven

  • Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

  • Possibly...

    If I've been helpful, let me know. If I haven't, let me know that too. 

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!