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.


    Regards,

    Subhash

  • Try this


  • SUBHASHn


    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.

    ['code]


    your code goes between these tags


    ['/code]


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


    Thanks.


    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!