filmov
tv
How to Combine Multiple Excel Files into One Excel || Macro VBA code|| 2 minutes easy excel tutorial

Показать описание
How to merged Multiple Excel Files into One Excel || Macro VBA code|| 2 minutes easy excel tutorial.
here is code.
-----------------------------------------
Sub tt()
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")
Set dirObj = mergeObj.Getfolder("C:\Users\kaka\Desktop\Rwork\test")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set bookList = Workbooks.Open(everyObj)
Range("A2:IV" & Range("A100000").End(xlUp).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A1000000").End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
bookList.Close
Next
End Sub
-----------------------------------------
If you’ve got something to work on with several excel files. More than 150 excel files generated by a web based application have to be merged into one file and then create a summary from it. A simple way to combine or merge multiple excel files, with macros in Excel.
If you’re not familiar with office macros, do not worry you 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 Run Sub. All excel (xls or xlsx) files inside working folder will be merged into current worksheet
here is code.
-----------------------------------------
Sub tt()
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")
Set dirObj = mergeObj.Getfolder("C:\Users\kaka\Desktop\Rwork\test")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set bookList = Workbooks.Open(everyObj)
Range("A2:IV" & Range("A100000").End(xlUp).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A1000000").End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
bookList.Close
Next
End Sub
-----------------------------------------
If you’ve got something to work on with several excel files. More than 150 excel files generated by a web based application have to be merged into one file and then create a summary from it. A simple way to combine or merge multiple excel files, with macros in Excel.
If you’re not familiar with office macros, do not worry you 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 Run Sub. All excel (xls or xlsx) files inside working folder will be merged into current worksheet
Комментарии