+ Reply to Thread
Results 1 to 4 of 4

Merge multiple excel files into one with multiple sheets

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    asdf
    MS-Off Ver
    Excel 2003
    Posts
    2

    Merge multiple excel files into one with multiple sheets

    I originally had an excel file with 6 sheets and two of them were most important. I needed to enter data for 100 items in my inventory which come in sets of two. To make entering the data and printing easier, I made two folders and put one sheet in one folder and one sheet in the other folder and made 100 copies because I had to enter data for 200 items (100 for folder a, 100 for folder b).

    So I ended up with:
    Folder A - XXX(001) - XXX(100)
    Folder B - YYY(001) - YYY(100)

    I now realize that I need to get that data back into the original file with the 6 sheets. I would like to have 100 of the original file, with all the files from folder a and b merged in or as new sheets or whatever works. I have found that I can do this manually by opening all the files, and copying them over the original sheets, but of course I have to do this 100 times and I am looking for a way to do this as a batch operation.

    Any help would be greatttttly appreciated.

    -Mark

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Merge multiple excel files into one with multiple sheets

    'WORKBOOKS TO 1 SHEET STACKED
    Here's a macro for collecting data from all files in a specific folder.The parts of the code that need to be edited are colored to draw your attention.


    I'd imagine you'd run a version of this for each folder targeted to a different consolidation sheet each.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-22-2012
    Location
    asdf
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Merge multiple excel files into one with multiple sheets

    I am confusored.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Merge multiple excel files into one with multiple sheets

    This is VBA. It's not for the faint of heart.

    You'll need to install the macro on that page I linked you to into your consilidation workbook.

    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. You must EDIT the macro for your environment, the parts in red on the web site are the key items. Set the name of the sheet in your workbook where you will collect the values for this version of the macro, and set the fPath to the correct path to that folder.
    5. Get out of VBA (Press Alt+Q)
    6. Save your workbook

    Repeat the steps above to create a SECOND macro to import the values from the other folder onto a different sheet, be sure to change the name of that second macro.


    The macros are installed and ready to use. Press Alt-F8 and select them from the macro list.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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