Nirvana
asked on
consolidate from multiple folders
I want to Consolidate multiple workbooks into one the below code work perfectly fine, however it picks only from one folder, however I want this to be picked from subfolders
Sub MergerNP()
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
Set dirObj = mergeObj.Getfolder("D:\main folder\folder\")
Set filesObj = dirObj.Files
For Each everyObj In filesObj
Set bookList = Workbooks.Open(everyObj)
bookList.Worksheets("7777").Activate
Range("A12:VII" & Range("A65536").End(xlUp).Row).Copy
ThisWorkbook.Worksheets(1).Activate
'Do not change below column
Range("A65536").End(xlUp).Offset(1, 0).PasteSpecial
Application.CutCopyMode = False
bookList.Close
Next
End Sub
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot Bill. Just can't understand how few brains are Brilliant and one dumb like me.
Welcome, glad that was helpful.
~bp
~bp
see this Search Files Recursively