I am new to VBA, Gone thourgh the many areas to understand my need but having some issues.
Goal:
I have 3 sheets like sheet1, sheet2 and sheet3 for all the files(20 excelsheets), It’s have same in all the spreadsheets. Now I have another file called Master where I need to merge all the sheets. Not in single sheets in master but for Master sheet also I have 3 sheets(Sheet1,sheet2 and sheet3) as the heading is same for all the sheets
Problem i am facing
The below code is merging only first sheet called sheet1 but not other sheets sheet2 and sheet3
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")
Set dirObj = mergeObj.Getfolder("C:\Excel\Path")
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
'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