+ Reply to Thread
Results 1 to 2 of 2

Combine multiple sheets with same name from seperate wbs in a folder into one workbook

  1. #1
    Registered User
    Join Date
    04-20-2015
    Location
    USA
    MS-Off Ver
    2010
    Posts
    51

    Combine multiple sheets with same name from seperate wbs in a folder into one workbook

    Hello All,

    I want to combine a specific tab ("Summation") in all workbooks in a folder to a single workbook. I have my macro asking for the file path, a file name pattern and the tab name from each workbook. The only 2 I really need are the file path and the tab name but the middle is just something that could be useful in future use.

    The only tab that is in the folder that is running the macro is "SumMaster" which also has a macro that compiles the numbers I need once all the sheets exist in a single workbook. I have roughly 200 files and this process has to be repeated yearly, so I am trying to automate it as much as possible.

    I have a code to combine the workbooks but it bombs out [Runtime Error '9'] at
    Please Login or Register  to view this content.
    I have tried included On Error Resume Next but that just causes Excel to completely freeze and requires a restart.

    If anyone has any suggestions on how to optimize or if they have another code that would work better, please let me know.
    I have included the entire code below.

    Please Login or Register  to view this content.

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

    Re: Combine multiple sheets with same name from seperate wbs in a folder into one workbook

    Dumbing it down for a moment, let's say you only had THREE files, each had a tab named SUMMATION and you wanted to move those 3 sheets into a single workbook as separate sheets.

    You can't have 3 sheets in the same workbook with the same name. So you're going to have to:

    1) Change the name of the SUMMATION sheet in each workbook to something else before moving/copying into the master. Perhaps:

    Summation1
    Summation2
    Summation3

    2) Copy the DATA from all the SUMMATION sheets into a single sheet in the master workbook, copying each set of data below the previous, but only copying the data, not the headers from each workbook. One assumes the layout of these sheets is the same, only the number of rows is different.

    Please advise.
    _________________
    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!)

+ 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. Replies: 0
    Last Post: 09-22-2015, 10:42 AM
  2. Vba/macro to combine multiple workbooks with multiple sheets into one workbook
    By ReshayM in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-03-2015, 01:00 PM
  3. [SOLVED] export from access multiple queries to same workbook into seperate sheets
    By trevor69 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2015, 04:33 AM
  4. [SOLVED] Help to combine two Modules from seperate workbooks to one workbook preform task
    By tcrjmom in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-30-2014, 06:14 PM
  5. Excel 2007 - Combine Multiple Workbooks into one Workbook Multiple Sheets
    By mab in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-29-2014, 02:48 PM
  6. Combine folder sheets to one master sheet
    By rchure in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-24-2014, 10:48 AM
  7. Combine several workbooks containing data in multiple sheets into a master Workbook
    By sunrize9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2014, 09:10 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