Below is a code to merge multiple workbooks to a single workbook. However, it's prompting to save each file that's being transferred.
I need the data to be transferred without interruption for saving files.
Your help is much appreciated.
Sub Merger()
Dim bookList As Workbook
Dim mergeObj As Object, dirObj As Object, filesObj As Object, everyObj As Object
Application.ScreenUpdating = False
Set mergeObj = CreateObject("C:\Users\Vincent\Desktop\856")
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)
Range("A2:IV" & Range("A65536").End(xlUp).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
bookList.Close
Next
End Sub
Perhaps you should look into turning off display alerts to prevent notifications from appearing.
You can do this by turning it off using...Application.DisplayAlerts = False
and back on using...Application.DisplayAlerts = True
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With