Macro to filter values

  • Hello

    I need an excel formula or Macro to do the following in my attached spreadsheet


    1. In the input tab filter on each unique product in column A to identify possible combinations of product with each of the values in column B-D (see expected output tab).


    2 . For each unique combination paste the values from column H in a separate tab.


    3 . Do this for each product


    I have attached the sample expected output in the expected output tab for product 1 but I will need to do the same for each unique product in my list.


    Thanks in advance

    query.xlsm

  • Hello,


    It seems to me you should be aiming for a two-step process ...


    Step 1 : Explode Data from your input sheet into separate sheets ( which is a very common request ...)


    Step 2 : Loop through your newly created sheets to produce all the possible combinations based on your 5-item-fixed List


    Thanks for confirming

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

  • Carim

    Changed the title of the thread from “excel formula or macro needed to filter values” to “Macro to filter values”.
  • Do mean you need each Product to have combinations on a new sheet (in the case of your sample file that would be 3 new sheets)?

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • If that is what you mean the try the attached file. Click the button on the Input Sheet


    Code assigned to the button

  • Hello . Thanks for this. This should work . Just one request , if the code can be made flexible. If I add more products in products column and more items to my fixed list , then currently it doesn't work . If that can be done that will be helpful

  • The code uses "CurrentRegion" for both the Input Products table and Fixed List so should work for any number of rows of either, but I will check.

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

  • You're welcome

    We now have a reputation system in place. If my reply helped please "Like" the reply by clicking the "Like" icon at bottom right of my reply.

Participate now!

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