+ Reply to Thread
Results 1 to 9 of 9

Combine multiple Ecxel files in one master file with VB

  1. #1
    Registered User
    Join Date
    09-11-2009
    Location
    Latvia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Combine multiple Ecxel files in one master file with VB

    Hi,

    I have multiple Excel files with the same structure (same sheets and column headers). Each file has multiple worksheets. My master file has same structure, too, but it has no information in it.

    I need to gather data from all files and combine it in the master file, duplicates are ok. I know that Access is right for that job, but I am not supposed to use it...Can someone please help me with the VB code to merge all data in one master file?

    Thank you!!

  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: Combine multiple Ecxel files in one master file with VB

    This code will open all the files in a single folder and import the activesheet into your master file's activesheet. It is not currently designed to import multiple sheets into multiple sheets. Hopefully this will get you most of the way there.

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

  3. #3
    Registered User
    Join Date
    11-08-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Combine multiple Ecxel files in one master file with VB

    I tried this macro tonite and it didnt do anything. I clicked run but no data populated. Am I doing something wrong?

  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: Combine multiple Ecxel files in one master file with VB

    Let's see your version of the macro. Post it here, don't forget to put code tags around it like in my post above.

  5. #5
    Registered User
    Join Date
    11-08-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Combine multiple Ecxel files in one master file with VB

    Please Login or Register  to view this content.

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

    Re: Combine multiple Ecxel files in one master file with VB

    Try this updated version:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-08-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Combine multiple Ecxel files in one master file with VB

    How do I add more than 1 range?

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

    Re: Combine multiple Ecxel files in one master file with VB

    Explain further.

  9. #9
    Registered User
    Join Date
    11-08-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Combine multiple Ecxel files in one master file with VB

    Quote Originally Posted by JBeaucaire View Post
    Explain further.

    I tried the script and it still doesnt work. Im going to close this thread because I am working on other leads. Thanks

+ 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