Im new to VBA, Im trying to write a code which helps me in consolidating the excel data from multiple files in to one single excel file.
I am getting this error when trying to run the macro.
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">Run Time Error '424' object requiredPlease find the below Macro CodeSub 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")
Set dirObj = mergeObj.Getfolder("M:\BIllable reports\Consolidation")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set boolist = Workbook.Open(everyObj)
Range("A1:IV" & Range("A65536").End(x1up).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A655536").End(x1up).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
Booklist.Close
Next
End Sub
</code></pre>
I am getting this error when trying to run the macro.
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">Run Time Error '424' object requiredPlease find the below Macro CodeSub 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")
Set dirObj = mergeObj.Getfolder("M:\BIllable reports\Consolidation")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set boolist = Workbook.Open(everyObj)
Range("A1:IV" & Range("A65536").End(x1up).Row).Copy
ThisWorkbook.Worksheets(1).Activate
Range("A655536").End(x1up).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
Booklist.Close
Next
End Sub
</code></pre>