Vba code for matching values

brooklyn2007

Board Regular
Joined
Nov 20, 2010
Messages
143
Hello,

I have this situation. I have two sheets. One is called Raw Data that contains a table from A to G. A is Product Id and B is Product Name. Cell E are stock quantities and cell G Wareouse. I want a Vba code to first take all IDs and Names of products in this sheet and post them accordingly below cell A4 and B4 in sheet Final report. Cells in range A and B in Raw Data repeat themselves. Final result should not post duplicates. Also final result should take only those rows of cells that contain one of the names in range D4 to G4 and look in range G in sheet Raw Data and post them below cells A4 and B4 in sheet Final report. Then it has to populate with values all range from D4 to G till the last of rows in sheet Final report. To lookup, values are located in column E in sheet Raw Data (stock quantities). it has to do a match by looking Product Id and header in rows D4 to G4 in sheet Final report and post the value taken in column E in sheet Raw Data. I know it can be done with pivot but I have so many Warehouses names.

This is the view of sheet Final report where data is needed

1677492563497.png


This is the view of Raw Data where data is taken

1677492832789.png
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Any help pls? I can do with pivot but I have over 100 warehouses and have to select them in a pool of over 200 warehouses. So doing it manually it would be time consuming. If there is vba code where I have specified the name of warehouses the program would take only data from them
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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