Copy sheet from different file

  • Hi guys,


    I need your help..!!


    I have around 30+ xl files in folder with different names but all files contain "All levels" sheet I just want to copy data from this All level sheet from all files to my Master sheet.
    However Header or first row remains same across all files i want it to be copied once.

  • Hello,


    There are several distinct issues in your request ...


    First you should test if you can handle one case ...


    Then you will add a loop to handle all your 30+ different files ...


    As an initial step, you could test the following:



    Hope this will help

    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 :)

  • Try this.
    Code assumes that the Workbook with the code in it is (saved) in the same folder as the Workbooks your copying from.
    Change references like Sheet names as required.

  • Hi...
    Thanks for your response..



    The code works fine but all files do not have this "All levels" sheet as first sheet, and Moreover its copying headers (Row 1) from all files which should not because its identical for all files, So it has to copy from only first file.
    In addition I do not want to keep the file in same folder.
    Kindly let me know changes.

  • There is a difference between "All levels" (See Post #1 and Post #4) and "All Levels" (See attachment). Capitals and non capital letters makes a difference.
    Try this. Change references as required. The Workbook with the code can not be saved in the same folder.

  • Hi Jolivanes
    Thanks a lot..!! its working absolutely fine..!!
    But small query is after running code when i apply filter, in second column, its only showing data which is copied from first file.
    May I get re-edited code.

Participate now!

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