Macro code to fetch only .pdf files from the folder

  • Hi ,

    I used the below code to get the file names in a folder and pasting them into new workbook called "Final" .But the problem is it is listing all the file names present in that particular folder,here I need only the .pdf files from the folder to be listed.

    Any changes to the code will be much appreciated.



  • Try this


    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

    Note: no apostrophe in the tags, just used for demonstration here.


    your code goes between these tags


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


    After 49 posts you should know t use Code Tags when posting code to the Forum.

Participate now!

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