VBA Macro/Script help?!?

brettd03

New Member
Joined
Apr 13, 2011
Messages
22
I am in desperate need of a code that will play a sound when certain data is entered into a cell.

My day job is with a large distribution facility. With the amount of packages that we process, it is inevitable that a UPS package gets put on a FedEx pallet or visa versa.

UPS tracking numbers all begin with 1z .....FedEx do not.

My goal is to create a permanent barcode for UPS and another for FedEx that are staged on the floor in front of the corresponding pallet. The user will scan the tracking number on the package, and then the barcode that corresponds with the pallet (UPS or FedEx). If the package is put on the wrong pallet, the sound is played.

I dont care what the sound is, but something like the WINDOWS ERROR sound would be great.

For example:

1z45689854663432 is scanned on the package, the floor barcode for FedEx is scanned, an error sound is played (because 1z is not FedEx)

Can anyone help?

Thanks in advance!!
 
Last edited:
It depends what row you're running it from. For example if you're in row 2 and you try to go back 2 rows (with the offset -2), there is no row 0.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
It depends what row you're running it from. For example if you're in row 2 and you try to go back 2 rows (with the offset -2), there is no row 0.

At this point...I dont even care. Ill hide R1 and R2 and start at 3.

Again, thanks for all of your help. My boss looked at me like I was stupid for suggesting this "program" about 4 months ago.

About 30 mis-shipments later; he asks for a solution!

Uh.......I gave you one already!

Cant wait to see his face...and all thanks to you.

Nice work!

:pray:
 
Upvote 0
I'll take 10% of your bonus. :)

Glad to help though, it helps me learn as well.

One thing I meant to ask is why do they have to scan a UPS and a FedEx code? Why not have the macro check if the tracking number starts with 1z and just put the UPS in and if it doesn't just put FedEx?
 
Upvote 0
Because packages are not sorted when they get to the verification/integration phase. You could have 14 UPS packages in a row, then one FedEx, and 20 more UPS.

Previously, the only "check" was visual. Someone would often ask the person a question and distract them and inevitably a package will get sorted incorrectly.

It wont be perfect, I still have to trust the person to use the tool, but it takes the "human error" excuse out of the equation.

Thanks again for your help.
 
Upvote 0

Forum statistics

Threads
1,224,590
Messages
6,179,763
Members
452,940
Latest member
rootytrip

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