+ Reply to Thread
Results 1 to 9 of 9

VBA to Consolidate a few Workbooks into 1 Workbook

  1. #1
    Registered User
    Join Date
    01-10-2012
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    62

    VBA to Consolidate a few Workbooks into 1 Workbook

    I'm trying to create a macro which does this:

    Allows me to choose a few workbooks (usually about 4-5 but could be anywhere from 2-15) from a server and consolidate them into one workbook. Each workbook needs to be a seperate sheet.
    Each workbook consists of 2 sheets however only the 1st sheet will be needed to transfer.
    At the end I would like to be able to create a summary sheet. (all of the previous sheets onto one summary sheet at the end)

    Other notes:
    These files all have different names so i have to be able to choose which files i want consolidated.
    I'm running excel 2010.
    I would like to be able to keep the same formatting as the sheet im transfering.

    So far... I was able to find this macro. The problem with this is that it puts all workbooks selected on one sheet, and for some reason it wraps the text.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated.

    Thanks.

  2. #2
    Registered User
    Join Date
    01-10-2012
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    I was able to find this code which does everything except it doesn't allow me to select just the first sheet of the workbook. How do i do this?

    Please Login or Register  to view this content.

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

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    Instead of this:
    Please Login or Register  to view this content.


    Use this:
    Please Login or Register  to view this content.
    _________________
    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!)

  4. #4
    Registered User
    Join Date
    01-10-2012
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    Perfect! Thank you so much!

    If anyone could help me add a summary sheet at the end of the macro, it would be greatly appreciated. Or if this is not possible please let me know and I can create a second macro.

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

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    "Summary sheet" could mean anything. If you want to post an example workbook showing a few imported sheets and a manual mockup of what the summary would be showing, we can help.

    Click GO ADVANCED and use the paperclip icon to post up a copy of your workbook.

  6. #6
    Registered User
    Join Date
    01-10-2012
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    Sorry, by summary i mean putting all the info that i just imported into the first sheets into one "summary" at the end

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

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    'MANY SHEETS TO ONE SHEET
    Here's a macro for merging data from multiple sheets into a "consolidation" sheet where the source sheets are the same layout.There's a sample file there, too, to make it easy to try it out.

  8. #8
    Registered User
    Join Date
    01-10-2012
    Location
    Detroit, Michigan
    MS-Off Ver
    Excel 2010
    Posts
    62

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    Thank you, you have been a huge help.

    Quick question, can i add this second macro to the first so that only one macro has to be ran to do all of this at one time?

    Thanks again!

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

    Re: VBA to Consolidate a few Workbooks into 1 Workbook

    You can simply call the macro at the end of yours.

    Please Login or Register  to view this content.

+ 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