FILTERING USING CRITERIA AS TITLE/HEADING

  • Hello. Please, I'm trying to write a macro that will filter and copy from one sheet to another using loop and put the criteria as the label/heading. In the attached example the criteria field is field 1.

    The code is as follows:

    The result I have and the expected result I need help with is as attached image pasted in msword.

    Thank you

    Okogbe Nathaniel

  • Welcome to the Forum. Please read the Forum Rules to understand how the Forum works and why I have added Code Tags to your post


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.Be sure to use them in future posts.


    How to use code tags


    Just highlight all of the code and press the <> in the post menu above button to add the code tags.


    Thanks.