PDA

View Full Version : Merging 5 files into 1



kualjo
03-05-2008, 12:54 PM
I have 5 files that each have code run on them to give them consistent layouts and formats. Once the 5 of them are done, I want to merge them all into a 6th file for further work, but without copying and pasting all the data. I tried the MergeWorkbook method, but it didn't work like I thought it would. The non-working code looks like this:

ActiveWorkbook.MergeWorkbook "C:\Folder\file1.xls"

The active workbook is the one I want all the others to merge into, starting with file1 and going to file5. Am I doing this wrong or is there another way?

lucas
03-05-2008, 07:27 PM
here are links to a few kb entries to get you started:

http://vbaexpress.com/kb/getarticle.php?kb_id=829

http://vbaexpress.com/kb/getarticle.php?kb_id=773

http://vbaexpress.com/kb/getarticle.php?kb_id=221