Combining Multiple workbook into single Workseet.

zeecharle

New Member
Joined
Aug 26, 2015
Messages
20
Anyone help me combine multiple workbook containing worksheet name "SUMMARY" into a single worksheet.

Please see the link below to understand more what I am saying here.

Thank you in advance.

For GENERAL SUMMARY(EXPECTED)

-Zee
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Do you want to copy just down to the last row used? Like for PART 1 do you just want cells B4:G20 copied? Since there are no more products below that?
 
Upvote 0
Remember to save your work before running any code. Then, try this:

Rich (BB code):
Sub copyParts()


Dim partNum As Integer, myBook As Workbook, mySheet As Worksheet, lastRow As Long, firstBlank As Long


Set myBook = Workbooks("GENERAL PARTS LIST")
Set mySheet = myBook.Sheets("GENERAL SUMMARY")

'I only put this part in to make sure the main sheet is clear first
mySheet.Range("B4:K1000").ClearContents


For partNum = 1 To 3
    With Workbooks("PART " & partNum).Sheets("SUMMARY")
        lastRow = .Range("B" & Rows.Count).End(xlUp).Row
        firstBlank = mySheet.Range("B" & Rows.Count).End(xlUp).Row + 1
    
        .Range("B4:G" & lastRow).Copy Destination:=mySheet.Range("B" & firstBlank)
    End With
Next partNum


End Sub
 
Upvote 0
Remember to save your work before running any code. Then, try this:
Rich (BB code):
Sub copyParts()Dim partNum As Integer, myBook As Workbook, mySheet As Worksheet, lastRow As Long, firstBlank As LongSet myBook = Workbooks("GENERAL PARTS LIST")Set mySheet = myBook.Sheets("GENERAL SUMMARY")'I only put this part in to make sure the main sheet is clear firstmySheet.Range("B4:K1000").ClearContentsFor partNum = 1 To 3    With Workbooks("PART " & partNum).Sheets("SUMMARY")        lastRow = .Range("B" & Rows.Count).End(xlUp).Row        firstBlank = mySheet.Range("B" & Rows.Count).End(xlUp).Row + 1            .Range("B4:G" & lastRow).Copy Destination:=mySheet.Range("B" & firstBlank)    End WithNext partNumEnd Sub

Sir svendiamond,

Please consider that if I add an another excel file named "PART 4", it should add another column in the "GENERAL SUMMARY". Also the file name of the workbook is not "PART ". It is just an example. It contains different name but same format inside the workbook.

The important part is that I should combine/merge/collaborate the multiple workbook that has the worksheet named "SUMMARY" into 1 single worksheet "GENERAL SUMMARY" and the "QUANTITY" should be seperated in different columns labeled by the workbook file name.

And when I run the code nothing happens.

-Zee
 
Upvote 0
There is a free add-in that can do what you're asking.

RDBMerge, Excel Merge Add-in for Excel


Sir AlphaFrog,

I need a macro code for this,

But Thanks for the Add-In.

Why I need a macro code? Becuase some of the computer here my workare does not have Microsoft Office installed on it. Some are just a free office software like OpenOffice, Kingsoft, etc.

So I need a macro code for this.

Thank you for your time in sharing.

-Zee
 
Upvote 0

Forum statistics

Threads
1,214,545
Messages
6,120,132
Members
448,947
Latest member
test111

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top