Combine Worksheets into One

Domroy

Board Regular
Joined
Mar 8, 2018
Messages
114
I have another one for you. I have an inventory sheet I get from a vendor every week. All I need are the columns:
Product Code
QTY in Stock

I would love for them to pull from all 5 sheets and make them one long list. I can't remember how do to that in PowerQuery. I get an updated inventory sheet every week from this vendor, and it takes me time every week to consolidate. Help?

Sheet is here:
https://www.dropbox.com/s/ehpixu3ps6rys18/7-9-18 CTD Inventory Availability Sheet .xls?dl=0

Thanks!
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi Judi,

This should do it:-


Code:
Sub Consolidate()

      Dim ws As Worksheet, sh As Worksheet
      Set sh = Sheets("Consolidated")
      
Application.ScreenUpdating = False

For Each ws In Worksheets
             If ws.Name <> "Consolidated" And ws.Name <> "Custom Bedding" Then
With ws.[A1].CurrentRegion
             Union(.Columns("A"), .Columns("G")).Offset(1).Copy
             sh.Range("A" & Rows.Count).End(3)(2).PasteSpecial xlValues
             End With
       End If
Next ws

Application.CutCopyMode = False
Application.ScreenUpdating = True

End Sub

You'll need to open a new sheet and name it "Consolidated".

The headings in all sheets of your sample need to be tidied up somewhat to be uniform. This will make the whole process quicker and seamless. I've made the "Qty in Stock" columns all Column G as one sheet had it in Column H. See the sample at the link below:-

http://ge.tt/70CbFjq2

I hope that this helps.

Cheerio,
vcoolio.
 
Upvote 0
This is wonderful. I'll save the sheet as a new name, and every week when I get the inventory, I'll just plunk in the tabs, and run my macro. Thank you!
 
Upvote 0
You're welcome Judi.

I'm glad to have been of assistance.

Cheerio,
vcoolio.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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