或許,這世間一切的好往往都是求之不得的吧。有心栽花花不發,無心插柳柳成蔭;有心栽柳柳不成蔭,無意種花花卻繁華。

how to merge different Excel files into one single Excel sheet 多薄多表合并

If you have multiple Excel sheets which have the same title line, then you can merge them into one single sheet with this method:

open one excel sheet,
ALT+F11, there will be a blank text editor,
Paste the following code:

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

change the folder path of where you files in
press “F5” or click on play icon to run the code (RunSub). You’ll see working progress on left sheet menu.

via:
http://www.oaultimate.com/office/merge-multiple-excel-files-into-a-single-spreadsheet-ms-excel-2007.html

///
友情鏈接:
Romeng's blog
yahaha分享的歌曲真好聽~消失在往復的時光中
Ekkles的日常
洛逸軒,歌好聽(ねがいごと - 柊南)


專題:好用的國外wordpress虛擬主機
buy and sell Bitcoin at LocalBitcoins
讀書之喜歡的文章
wordpress org官方推薦Number 1的主機:bluehost(藍色主機,30天內全額退款)