Separating $1 and $2 Coupons by Bar Code

Mamagregory

New Member
Joined
Apr 11, 2014
Messages
25
I'm having a hard time coming up with a macro that will sort this data the way I want. We have farmers market coupon barcodes that will be for $1 and $2 food coupons. The $1 coupons will all have barcodes that fall within this range: 850001-860000. The coupons will always start with HB2016. So the $1 coupons will be HB2016580001 to HB2016860000. We have to modify our spreadsheet (example attached) that previously only tracked $2 coupons to make sure we don't give any farmer too much money back. This is what I want the macro to do:

1. Skip the summary sheet at the front and the last two sheets ("raw data" and "vouchering database").

2. On every other sheet which will be for each farmer's coupons, there will be rows of data as on the example. When we run the macro it will check for data in B5 of each sheet and if it is there it will add a column to the right of that column and search the B column for any coupons in the HB2016580001 to HB2016860000 range, putting them in the inserted coupons. It will not erase any of the data in column C if it exists but rather move it over. Then it will go to the next column (the data that was in C but got moved over) and do the same thing until it hits a blank row 5 with no data in it. Then it will move on to the next farmer's worksheet stopping when it gets to the end or the raw data worksheet.

Example data can be found here with 3 farmers. There will be up to 200 farmers on the final data though- https://drive.google.com/file/d/0BzEMJRQuHZM1TVllRTl1R1ZzaGs/view?usp=sharing. It is possible for a farmer to have some $2 and some $1 coupons or they might just have one or the other. You can ignore the data on the summary and raw data sheets as that is not relevant to this macro but we need it for other macros we are using on this data. I am also wondering what will happen if the macro has already done some of the data and we then add additional rows. Is there a way to make it skip the rows that have already been parsed into $2 and $1 coupons based on the barcode?

Big thanks to anyone who can help or point me in the right direction as I'm still a newbie with this stuff :)
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Gah - I meant Putting them in the inserted columns (not inserted coupons). So it would create a column to the right and then put only the $1 coupons in there. All others outside that range would stay in the column they were in.
 
Upvote 0
Sorry I see now in the tips not to reply to your own message because it shows as answered. Does anyone who read this have any advice? If not to write the macro then to direct me to a resource that can help? Thanks in advance.
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,978
Latest member
rrauni

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