Beruflich Dokumente
Kultur Dokumente
1 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
OA Ultimate
About Us
Privacy Policy
Disclaimer
Home
Computers
Hardware
Internet
Networking
Office
Search
Home
Office
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
Although Im not familiar with office macros, but i can use it easily by just write a simple xls file merger code on vb editor, change the working folder path and cell starter reference name inside the
code to suit your reference, and then click RunSub. All excel (xls or xlsx) files inside working folder will be merged into current worksheet.
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
2 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
Watch it on YouTube
For more detail, heres what i did to merge multiple excel files with MS Excel 2007.
Gather all xls or xlsx files that you wanted to merge into a folder. Remember that this merger macros will only grab the first worksheet on spreadsheet files. So make sure that all contents is on
the first worksheet before continue.
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
3 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
Close all working excel files so you can focus only on merging files.
On MS Excel, create new spreadsheet by simply pressing CTRL+N.
And open Microsoft Visual Basic editor by pressing ALT+F11, youll see a blank text editor.
Now open by doubleclicking ThisWorkBook on the left sheet menu.
Paste the following macros code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Sub simpleXlsMerger()
Dim bookList As Workbook
Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object
Application.ScreenUpdating = False
Set mergeObj = CreateObject("Scripting.FileSystemObject")
'change folder path of excel files here
Set dirObj = mergeObj.Getfolder("D:\change\to\excel\files\path\here")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set bookList = Workbooks.Open(everyObj)
'change "A2" with cell reference of start point for every files here
'for example "B3:IV" to merge all files start from columns B and rows 3
'If you're files using more than IV column, change it to the latest column
'Also change "A" column on "A65536" to the same column as start point
Range("A2:IV" & Range("A65536").End(xlUp).Row).Copy
ThisWorkbook.Worksheets(1).Activate
'Do not change the following column. It's not the same column as above
Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
bookList.Close
Next
End Sub
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
4 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
If everything configured already, press F5 or click on play icon to run the code (RunSub). Youll see working progress on left sheet menu.
If all done, you can now switch to worksheet to see the result.
If you set a new folder within the code, and then hit F5 or press SubRun button, the result will be added into current worksheet bellow the previous data. Thats mean it will not overwritten the last
result but as another merge to previous merged data. In conclusion, you can spam change folder path and hit F5 to run the code in order to merge all files on provided folder into current worksheet. If
you want to start new merge for multiple xls or xlsx files you have to clear the current worksheet, or create new file for merge. I hope theres also a way to merge spreadsheet similar to this but for
LibreOffice, since i also work on several ods files.
Update
Read also merge excel with simple merger tool for small files merge without macros.
Article by M Riza
Is a blogger since 2007, founder and editor of Oa Ultimate. Working as a network administrator, computer technician, database and web maintainer | Twitter | G+
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
5 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
Related Posts
This Category
More Articles..
Find duplicates in excel and LibreOffice Calc
Unhide windows files and folders hidden by virus without attrib
Simple excel calculate date with excel form
Several things about MS Excel 2007 you might want to know
Vlookup, Microsoft Excel and LibreOffice Calc
Converting excel time format, 24 to 12 hours vise versa
2 ways to show and recover hidden files by virus
Advertisement
Oa Blog
Google+
Facebook
Write a comment..
21 Comments Merge multiple excel files into a single spreadsheet (MS Excel 2007)
1.
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
6 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
2.
3.
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
7 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
Set a new variable for number of columns you have on sources files.
Write the following lines before loop
Dim i
i = 0
into
Range("A1").Offset(0, i).PasteSpecial
increase i value with number of columns you have on source xls files (for example you have 9 columns on sources files)
i = i + 9
4.
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
8 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
On the loop set WSA to add new sheet and then set activate
Set WSA = ThisWorkbook.Worksheets.Add
WSA.Activate
5.
6.
According to Microsoft help forum, the above message occur when you have cell that contain more than 911 characters in one of your source files.
More info : http://goo.gl/aQJnTn
7.
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
9 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
I have 12 workbooks with 60/62 worksheets each. The last column is AI/AJ/AL in different worksheets.
8.
9.
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
10 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
10.
Leave a Reply
Name *
Mail *
Website
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
11 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
CAPTCHA Code*
Subcribe
Popular Posts
Step-by-step Install and Configure Stereoscopic 3D media player with MPC [Aug 25, 2012]
Playing 3D SBS Videos as 3D Anaglyph with Media Player Classic [Dec 24, 2011]
Photo sharing Android, Bluestacks and PC for WhatsApp [Dec 14, 2012]
Change WhatsApp profile picture with image from DropBox folder [Dec 27, 2012]
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
12 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
Merge multiple excel files into a single spreadsheet (MS Excel 2007) [Mar 18, 2013]
Recent Posts
Simple Excel merger (single worksheet and small files only) [Nov 05, 2013]
Computer slow boot and disable bluestacks startup [Jun 28, 2013]
5 easy ways send picture to WhatsApp chat on Windows PC [Jun 13, 2013]
Internet safety tips: how to safe on the internet [Jun 02, 2013]
18/10/2014 03:43 PM
Merge multiple excel files into a single spreadsheet (MS Excel 2007)
13 of 13
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-exce...
31
Like
10
18/10/2014 03:43 PM