Hey folks,
I've got another one for the genius residents of this fine forum. At work I run a report that creates an excel file. I've already created a master with the VBA required to clean it up so the process will be run the query, paste into the master, then run the macros and save the results.
In the master there will be a sheet with a list of SKU's in column B. In columns E - Z there are possible location codes where those SKU's are supposed to be stored, but different SKU's will have different amounts of possible locations. Some may have one, others may use the full range. In either case, each row will contain a unique SKU identifier followed by some number of location codes. This sheet will not change is and used for reference. Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Grade[/TD]
[TD]SKU[/TD]
[TD]Description[/TD]
[TD]Name[/TD]
[TD]Location1[/TD]
[TD]Location2[/TD]
[TD]Location3[/TD]
[/TR]
[TR]
[TD]Gold[/TD]
[TD]123456[/TD]
[TD]BlahBlah1[/TD]
[TD]Blah1[/TD]
[TD]100.A.1[/TD]
[TD]100.A.2[/TD]
[TD]100.A.3[/TD]
[/TR]
[TR]
[TD]Silver[/TD]
[TD]234567[/TD]
[TD]BlahBlah2[/TD]
[TD]Blah2[/TD]
[TD]200.A.1[/TD]
[TD]200.A.2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bronze[/TD]
[TD]345678[/TD]
[TD]BlahBlah3[/TD]
[TD]Blah3[/TD]
[TD]300.A.1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
When I export my data and trim it, it will show an itemized list of barcodes, the SKU of the item, and the current location code. What I'm trying to do is add a formula or VBA to the data dump to reference the above sheet and say whether or not a line item in the report is in an allowed location. Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Barcode[/TD]
[TD]SKU[/TD]
[TD]Description[/TD]
[TD]Current Location[/TD]
[TD]Location Good?[/TD]
[/TR]
[TR]
[TD]10000[/TD]
[TD]123456[/TD]
[TD]BlahBlah1[/TD]
[TD]100.A.2[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]20000[/TD]
[TD]234567[/TD]
[TD]BlahBlah2[/TD]
[TD]200.A.3[/TD]
[TD]Nope[/TD]
[/TR]
[TR]
[TD]30000[/TD]
[TD]345678[/TD]
[TD]BlahBlah3[/TD]
[TD]300.A.1[/TD]
[TD]Yes[/TD]
[/TR]
</tbody>[/TABLE]
Thoughts?
I've got another one for the genius residents of this fine forum. At work I run a report that creates an excel file. I've already created a master with the VBA required to clean it up so the process will be run the query, paste into the master, then run the macros and save the results.
In the master there will be a sheet with a list of SKU's in column B. In columns E - Z there are possible location codes where those SKU's are supposed to be stored, but different SKU's will have different amounts of possible locations. Some may have one, others may use the full range. In either case, each row will contain a unique SKU identifier followed by some number of location codes. This sheet will not change is and used for reference. Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Grade[/TD]
[TD]SKU[/TD]
[TD]Description[/TD]
[TD]Name[/TD]
[TD]Location1[/TD]
[TD]Location2[/TD]
[TD]Location3[/TD]
[/TR]
[TR]
[TD]Gold[/TD]
[TD]123456[/TD]
[TD]BlahBlah1[/TD]
[TD]Blah1[/TD]
[TD]100.A.1[/TD]
[TD]100.A.2[/TD]
[TD]100.A.3[/TD]
[/TR]
[TR]
[TD]Silver[/TD]
[TD]234567[/TD]
[TD]BlahBlah2[/TD]
[TD]Blah2[/TD]
[TD]200.A.1[/TD]
[TD]200.A.2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Bronze[/TD]
[TD]345678[/TD]
[TD]BlahBlah3[/TD]
[TD]Blah3[/TD]
[TD]300.A.1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
When I export my data and trim it, it will show an itemized list of barcodes, the SKU of the item, and the current location code. What I'm trying to do is add a formula or VBA to the data dump to reference the above sheet and say whether or not a line item in the report is in an allowed location. Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Barcode[/TD]
[TD]SKU[/TD]
[TD]Description[/TD]
[TD]Current Location[/TD]
[TD]Location Good?[/TD]
[/TR]
[TR]
[TD]10000[/TD]
[TD]123456[/TD]
[TD]BlahBlah1[/TD]
[TD]100.A.2[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]20000[/TD]
[TD]234567[/TD]
[TD]BlahBlah2[/TD]
[TD]200.A.3[/TD]
[TD]Nope[/TD]
[/TR]
[TR]
[TD]30000[/TD]
[TD]345678[/TD]
[TD]BlahBlah3[/TD]
[TD]300.A.1[/TD]
[TD]Yes[/TD]
[/TR]
</tbody>[/TABLE]
Thoughts?