SWETHAKHATRI88
New Member
- Joined
- Jul 29, 2022
- Messages
- 10
- Office Version
- 2021
- Platform
- MacOS
I have in total 5 excel workbooks. Workbook 5 has the VBA code. Workbooks 1-4 have the same sheet names but with different content. I do have the below code to import 2 sheets from workbook 1 into workbook 5. Is there any way I can look for the the next blank cell in workbook 5 and import the corresponding data from workbooks 2, 3 and 4.
Final Output should be
Workbook 1 - Copy Sheets 1 and 2 into Workbook 5 (Master Workbook)
Workbook 2 - Copy data from Sheets 1 and 2 from Row 6 only into Workbook 5 next available blank row
Workbook 3 - Copy data from Sheets 1 and 2 from Row 6 only into Workbook 5 next available blank row
Workbook 4 - Copy data from Sheets 1 and 2 from Row 6 only into Workbook 5 next available blank row
My code for workbook 1 is below
Application.ScreenUpdating = False
Set ClosedBook = Workbooks.Open("C:\Status Reports\Workbook1.xlsb")
Closedbook.Sheets("Sheet1").CopyAfter: = ThisWorkbook.Sheets("Control")
Closedbook.Sheets("Sheet2").CopyAfter: = ThisWorkbook.Sheets("Control")
Closedbook.Close SaveChanges: = False
Thanks
Final Output should be
Workbook 1 - Copy Sheets 1 and 2 into Workbook 5 (Master Workbook)
Workbook 2 - Copy data from Sheets 1 and 2 from Row 6 only into Workbook 5 next available blank row
Workbook 3 - Copy data from Sheets 1 and 2 from Row 6 only into Workbook 5 next available blank row
Workbook 4 - Copy data from Sheets 1 and 2 from Row 6 only into Workbook 5 next available blank row
My code for workbook 1 is below
Application.ScreenUpdating = False
Set ClosedBook = Workbooks.Open("C:\Status Reports\Workbook1.xlsb")
Closedbook.Sheets("Sheet1").CopyAfter: = ThisWorkbook.Sheets("Control")
Closedbook.Sheets("Sheet2").CopyAfter: = ThisWorkbook.Sheets("Control")
Closedbook.Close SaveChanges: = False
Thanks