+ Reply to Thread
Results 1 to 5 of 5

Merge several files

  1. #1
    Registered User
    Join Date
    12-05-2022
    Location
    Islamabad
    MS-Off Ver
    2019
    Posts
    21

    Merge several files

    I possess more than 100 files, and each of them comprises nine tabs, which share the same name and headers.

    My objective is to consolidate the first tab, "Parts," of every file into one master file. Furthermore, I aim to merge the fourth tab, "Interchange," into another master file.

    Would it be possible for you to provide me with a VBA or Power Query solution? For your reference, I have attached a file as an example. Thank you in advance for your help.


    partDetail-2023-03-03-1.xlsx

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Merge several files

    Have all your workbooks where you need the data from in one folder without any other workbooks.
    Start a new (empty) Workbook, name it's first sheet "Parts" and enter the headers (8 Columns) in each top cell.
    Copy following code and paste it in a regular module.
    Save the Workbook as an .xlsm type workbook in the same folder.

    Please Login or Register  to view this content.
    Run the macro.
    Go for a sarsaparilla and when finished with that, you should have all the data in your "Master"

    Do the same for the other sheet (Change the "Parts" sheet name to whatever sheet name data needs to be copied.)
    Experience trumps academics every day of the week and twice on Sunday.

  3. #3
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,895

    Re: Merge several files

    An alternative with Power Query

    https://www.youtube.com/watch?v=OFt9b6DgvY0
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  4. #4
    Registered User
    Join Date
    12-05-2022
    Location
    Islamabad
    MS-Off Ver
    2019
    Posts
    21

    Re: Merge several files

    Both PowerQuery and VBA code work fine for me. Thank you STARS for your help.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Merge several files

    Thank you for the update. Very much appreciated and good luck.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2007 : merge two files?
    By nanopants in forum Excel General
    Replies: 3
    Last Post: 04-19-2012, 08:34 AM
  2. Merge two files
    By alinagoo in forum Excel General
    Replies: 7
    Last Post: 04-21-2010, 07:53 AM
  3. Merge two files..
    By maxthebear in forum Excel General
    Replies: 2
    Last Post: 03-24-2010, 03:27 PM
  4. How to merge files?
    By Larryq22 in forum Excel General
    Replies: 3
    Last Post: 02-07-2009, 01:07 PM
  5. Merge 2 XLS files into 1
    By vbjohn in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-13-2007, 02:59 PM
  6. [SOLVED] Merge txt files
    By Ronny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-02-2006, 11:10 AM
  7. [SOLVED] MERGE 2 FILES
    By will A in forum Excel General
    Replies: 10
    Last Post: 11-18-2005, 03:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1