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

免费的公共DNS推薦

Windows 电脑一键关机与睡眠 - 桌面快捷方式教程

Windows电脑的休眠和睡眠的区别

優質網絡加速推薦~expressvpn,能用好用,稳定可靠,業內高端品牌,用戶的認可度高,不記錄活動日誌,采用最高级别的256位AES加密技术来加密你的所有数据,30天內可以退款,不限速,沒有流量限制,一個訂閱支持8個設備同時在線。優惠:购买两年期的订阅免费送4个月,大概4.99美元一个月、每天合0.17美元,也就是1块多钱;购买一年期的订阅免费送3个月,大概6.67美元一个月;一个月的订阅,大概12.95美元一个月。

NordVPN Threat Protection是一项网络安全功能,旨在保护用户免受在线威胁。它可以检测和阻止恶意软件、病毒和其他类型的网络攻击。此功能还可以帮助防止用户访问钓鱼网站和其他恶意网站。另外,它还可以阻止广告,检测和过滤出广告内容,帮助用户避免看到不想要的广告,从而提供更流畅的浏览体验。通过启用NordVPN Threat Protection,用户可以在浏览互联网时享受更安全的体验。