Macro to Compare to Sheets and Copy Notes

THRASHER69

Board Regular
Joined
Mar 29, 2012
Messages
200
Hello,

I'm needing some help with a macro. I have 2 sheets. The first one named "Back Orders" is the new report and the second one named "BO Save" is the saved sheet with notes. I would like to have a macro that compares the lines of each sheet and copies the notes from the BO Save sheet and pastes them under the matching line of the Back Orders sheet. If the line is gone it would just skip to the next one. I will post my sheets below to hopefully make things a bit clearer. Both sheets start at row 7 with a header. I put the notes I'm talking about in red. Thank you.

Back Orders Sheet:
[TABLE="width: 1366"]
<tbody>[TR]
[TD]Conf. Date[/TD]
[TD]Entr. Dt[/TD]
[TD]Item number[/TD]
[TD]Item Name[/TD]
[TD]CO Number[/TD]
[TD]Customer #[/TD]
[TD]Rem Qty[/TD]
[TD]Customer Name[/TD]
[TD]Remaining[/TD]
[TD]St[/TD]
[/TR]
[TR]
[TD] 1/6/14[/TD]
[TD] 11/14/13[/TD]
[TD]23B88G001[/TD]
[TD]2.56"5K MN ITBOP-DBL2.00" RAMS[/TD]
[TD]0001443414[/TD]
[TD]103623[/TD]
[TD]1[/TD]
[TD]RED MAN PIPE & SUPPLY -JOURDANTON#71[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"][/TD]
[/TR]
[TR]
[TD] 2/10/14[/TD]
[TD] 1/3/14[/TD]
[TD]MTR-ROD CLAMP[/TD]
[TD]MTR SET F/HERCULES ROD CLAMP[/TD]
[TD]0001447338[/TD]
[TD]112575[/TD]
[TD]1[/TD]
[TD]SONAL ENTERPRISES[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD] 2/11/14[/TD]
[TD] 1/29/14[/TD]
[TD]20366762[/TD]
[TD]1.5"SET RAINBOW CONE PKG[/TD]
[TD]0001451177[/TD]
[TD]131654[/TD]
[TD]20[/TD]
[TD]WEATHERFORD ALS INTERNATIONAL[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD="colspan: 10"][/TD]
[/TR]
[TR]
[TD] 2/18/14[/TD]
[TD] 12/17/13[/TD]
[TD]23B88D001[/TD]
[TD]2.56"5K MN ITBOP-1.5"&BLKHSN R[/TD]
[TD]0001447011[/TD]
[TD]76700[/TD]
[TD]2[/TD]
[TD]MCJUNKIN RED MAN CORP CHARLESTON WV[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"][/TD]
[/TR]
[TR]
[TD] 2/19/14[/TD]
[TD] 1/22/14[/TD]
[TD]23B88D001[/TD]
[TD]2.56"5K MN ITBOP-1.5"&BLKHSN R[/TD]
[TD]0001450320[/TD]
[TD]76700[/TD]
[TD]13[/TD]
[TD]MCJUNKIN RED MAN CORP CHARLESTON WV[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"][/TD]
[/TR]
[TR]
[TD] 2/24/14[/TD]
[TD] 12/2/13[/TD]
[TD]23B88G001[/TD]
[TD]2.56"5K MN ITBOP-DBL2.00" RAMS[/TD]
[TD]0001445249[/TD]
[TD]71805[/TD]
[TD]10[/TD]
[TD]LUFKIN HYDRAULIC LIFT[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"][/TD]
[/TR]
[TR]
[TD] 2/28/14[/TD]
[TD] 2/10/14[/TD]
[TD]37100105[/TD]
[TD]1"600# BRONZE BV-2PC[/TD]
[TD]0001452582[/TD]
[TD]134682[/TD]
[TD]14[/TD]
[TD]DNOW LP - TUSCALOOSA, AL[/TD]
[TD]Money[/TD]
[TD]27[/TD]
[/TR]
</tbody>[/TABLE]

BO Save sheet:
[TABLE="width: 1129"]
<tbody>[TR]
[TD]Conf. Date[/TD]
[TD]Entr. Dt[/TD]
[TD]Item number[/TD]
[TD]Item Name[/TD]
[TD]CO Number[/TD]
[TD]Customer #[/TD]
[TD]Rem Qty[/TD]
[TD]Customer Name[/TD]
[TD]Remaining[/TD]
[TD]St[/TD]
[/TR]
[TR]
[TD] 1/6/14[/TD]
[TD] 11/14/13[/TD]
[TD]23B88G001[/TD]
[TD]2.56"5K MN ITBOP-DBL2.00" RAMS[/TD]
[TD]0001443414[/TD]
[TD]103623[/TD]
[TD]1[/TD]
[TD]RED MAN PIPE & SUPPLY -JOURDANTON#71[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]NP BOP 23B88G001-NP Due 3-5 Domino[/TD]
[/TR]
[TR]
[TD] 1/29/14[/TD]
[TD] 12/10/13[/TD]
[TD]WELLHEAD - HHS[/TD]
[TD]HHS SUBMERSIBLE WELLHEAD[/TD]
[TD]0001446158[/TD]
[TD]35725[/TD]
[TD]3[/TD]
[TD]DYNAFLO ARTIFICIAL LIFT SYSTEMS[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 1/29/14[/TD]
[TD] 12/10/13[/TD]
[TD]WELLHEAD - HHS[/TD]
[TD]HHS SUBMERSIBLE WELLHEAD[/TD]
[TD]0001446159[/TD]
[TD]43840[/TD]
[TD]10[/TD]
[TD]FIVE STAR EQUIPMENT[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 1/31/14[/TD]
[TD] 1/15/14[/TD]
[TD]13111170[/TD]
[TD]2.5"8RD*2.5"8RD*2"11.5V*1" CT[/TD]
[TD]0001449543[/TD]
[TD]RMENERGYAU[/TD]
[TD]6[/TD]
[TD]R&M ENERGY SYSTEMS AUSTRALIA PTY LD[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD] 1/31/14[/TD]
[TD] 1/15/14[/TD]
[TD]1292A067[/TD]
[TD]2.87"8RD X6"LG J55 TBG NIPPLE[/TD]
[TD]0001449543[/TD]
[TD]RMENERGYAU[/TD]
[TD]6[/TD]
[TD]R&M ENERGY SYSTEMS AUSTRALIA PTY LD[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD] 1/31/14[/TD]
[TD] 1/15/14[/TD]
[TD]29853129[/TD]
[TD]2.5"8R PCSB-1.25"G &ORG LUBCAP[/TD]
[TD]0001449543[/TD]
[TD]RMENERGYAU[/TD]
[TD]6[/TD]
[TD]R&M ENERGY SYSTEMS AUSTRALIA PTY LD[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD] 1/31/14[/TD]
[TD] 1/15/14[/TD]
[TD]12048233[/TD]
[TD]2.5"8RD BOP 1.25"HSN-LUGLESS C[/TD]
[TD]0001449543[/TD]
[TD]RMENERGYAU[/TD]
[TD]6[/TD]
[TD]R&M ENERGY SYSTEMS AUSTRALIA PTY LD[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Shipping Instructions[/TD]
[/TR]
[TR]
[TD] 2/10/14[/TD]
[TD] 12/19/13[/TD]
[TD]21206006C[/TD]
[TD]1.5"ROD BOSS CLAMP-CADMIUM TR[/TD]
[TD]0001447338[/TD]
[TD]112575[/TD]
[TD]20[/TD]
[TD]SONAL ENTERPRISES[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD] 2/10/14[/TD]
[TD] 1/3/14[/TD]
[TD]MTR-ROD CLAMP[/TD]
[TD]MTR SET F/HERCULES ROD CLAMP[/TD]
[TD]0001447338[/TD]
[TD]112575[/TD]
[TD]1[/TD]
[TD]SONAL ENTERPRISES[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Shipping Instructions[/TD]
[/TR]
[TR]
[TD] 2/11/14[/TD]
[TD] 1/29/14[/TD]
[TD]20366762[/TD]
[TD]1.5"SET RAINBOW CONE PKG[/TD]
[TD]0001451177[/TD]
[TD]131654[/TD]
[TD]20[/TD]
[TD]WEATHERFORD ALS INTERNATIONAL[/TD]
[TD]Money[/TD]
[TD]23[/TD]
[/TR]
[TR]
[TD="colspan: 10"].-2 Sets Canada Shipped 2-27[/TD]
[/TR]
[TR]
[TD] 2/12/14[/TD]
[TD] 1/15/14[/TD]
[TD]WELLHEAD - HHS[/TD]
[TD]HHS SUBMERSIBLE WELLHEAD[/TD]
[TD]0001449531[/TD]
[TD]21605[/TD]
[TD]1[/TD]
[TD]CENTRILIFT INC TULSA OK[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 2/18/14[/TD]
[TD] 12/17/13[/TD]
[TD]23B88D001[/TD]
[TD]2.56"5K MN ITBOP-1.5"&BLKHSN R[/TD]
[TD]0001447011[/TD]
[TD]76700[/TD]
[TD]2[/TD]
[TD]MCJUNKIN RED MAN CORP CHARLESTON WV[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]NP BOP 23B88G001-NP Due 3-3 Domino[/TD]
[/TR]
[TR]
[TD] 2/19/14[/TD]
[TD] 1/22/14[/TD]
[TD]23B88D001[/TD]
[TD]2.56"5K MN ITBOP-1.5"&BLKHSN R[/TD]
[TD]0001450320[/TD]
[TD]76700[/TD]
[TD]13[/TD]
[TD]MCJUNKIN RED MAN CORP CHARLESTON WV[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]NP BOP 23B88G001-NP Due 3-3 Domino[/TD]
[/TR]
[TR]
[TD] 2/19/14[/TD]
[TD] 2/5/14[/TD]
[TD]10310123[/TD]
[TD]2.5"8RD M X 1.5"TYPE S[/TD]
[TD]0001451991[/TD]
[TD]76700[/TD]
[TD]3[/TD]
[TD]MCJUNKIN RED MAN CORP CHARLESTON WV[/TD]
[TD]Money[/TD]
[TD]33[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 2/20/14[/TD]
[TD] 2/4/14[/TD]
[TD]10906161[/TD]
[TD]2"SLIP-4.5-7"HHS[/TD]
[TD]0001451836[/TD]
[TD]62021[/TD]
[TD]10[/TD]
[TD]J & W SERVICES & EQUIPMENT[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 2/20/14[/TD]
[TD] 2/7/14[/TD]
[TD]21040006[/TD]
[TD]1.12"-1.5"T252 ROD ROTATOR[/TD]
[TD]0001452399[/TD]
[TD]85900[/TD]
[TD]20[/TD]
[TD]DNOW LP - L565[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 2/21/14[/TD]
[TD] 1/10/14[/TD]
[TD]40031120E[/TD]
[TD]20"SJ EPXY W/NI-RES & VITON[/TD]
[TD]0001448885[/TD]
[TD]T00104143[/TD]
[TD]1[/TD]
[TD]CAPE ENVIRONMENTAL MANAGEMENT INC.[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Still In Testing[/TD]
[/TR]
[TR]
[TD] 2/21/14[/TD]
[TD] 2/11/14[/TD]
[TD]21040006[/TD]
[TD]1.12"-1.5"T252 ROD ROTATOR[/TD]
[TD]0001452780[/TD]
[TD]134605[/TD]
[TD]7[/TD]
[TD]DNOW LP - BAKERSFIELD, CA[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 2/24/14[/TD]
[TD] 12/2/13[/TD]
[TD]23B88G001[/TD]
[TD]2.56"5K MN ITBOP-DBL2.00" RAMS[/TD]
[TD]0001445249[/TD]
[TD]71805[/TD]
[TD]10[/TD]
[TD]LUFKIN HYDRAULIC LIFT[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]NP BOP 23B88G001-NP Due 3-14 Domino[/TD]
[/TR]
[TR]
[TD] 2/24/14[/TD]
[TD] 2/3/14[/TD]
[TD]40031116E[/TD]
[TD]16"SJ EPXY W/NI-RES & VITON[/TD]
[TD]0001451825[/TD]
[TD]127501[/TD]
[TD]1[/TD]
[TD]ULTRAFLOTE CORP[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Still In Testing[/TD]
[/TR]
[TR]
[TD] 2/24/14[/TD]
[TD] 2/4/14[/TD]
[TD]21040006[/TD]
[TD]1.12"-1.5"T252 ROD ROTATOR[/TD]
[TD]0001451918[/TD]
[TD]76720[/TD]
[TD]16[/TD]
[TD]MCJUNKIN RED MAN CORP #112[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 2/25/14[/TD]
[TD] 2/5/14[/TD]
[TD]10906161[/TD]
[TD]2"SLIP-4.5-7"HHS[/TD]
[TD]0001452096[/TD]
[TD]43100[/TD]
[TD]1[/TD]
[TD]FECHNER PUMP[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today[/TD]
[/TR]
[TR]
[TD] 2/27/14[/TD]
[TD] 1/31/14[/TD]
[TD]10906151[/TD]
[TD]3"SLIP-4.5-7"HHS[/TD]
[TD]0001451617[/TD]
[TD]62021[/TD]
[TD]5[/TD]
[TD]J & W SERVICES & EQUIPMENT[/TD]
[TD]Money[/TD]
[TD]37[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today [/TD]
[/TR]
[TR]
[TD] 2/27/14[/TD]
[TD] 2/20/14[/TD]
[TD]37200107[/TD]
[TD]1-1/2"1500# 200 BV-2PC[/TD]
[TD]0001453798[/TD]
[TD]103616[/TD]
[TD]2[/TD]
[TD]RED MAN PIPE & SUPPLY -LOVINGTONM#32[/TD]
[TD]Money[/TD]
[TD]22[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Ship From Consign Due 3-14 EMC -> ABC[/TD]
[/TR]
[TR]
[TD] 2/27/14[/TD]
[TD] 2/27/14[/TD]
[TD]11203161[/TD]
[TD]2.5"8RD SBT W/1.5"SOFT & LUB[/TD]
[TD]0001454542[/TD]
[TD]23801[/TD]
[TD]2[/TD]
[TD]CLIFTON EQUIPMENT & SUPPLY[/TD]
[TD]Money[/TD]
[TD]44[/TD]
[/TR]
[TR]
[TD="colspan: 10"]Today? Pick Up?[/TD]
[/TR]
</tbody>[/TABLE]
 
One more thing I just now noticed that might help. The ones that are single rows and meet the criteria work. It's the ones that have multiple rows that meet the criteria that are not working. I do not know how to fix this but maybe you do.
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Looking at one sheet really does not tell me anything, since the criteria also looks at the other sheet. Also, I have no way of knowing what should have matched and what should not have matched. Again, you can troubleshoot the code by stepping through the procedure one line at a time, using the F8 function key. Open the VBE with Alt + F11, click anywhere inside the procedure and press F8 to begin. Use your mouse pointer to hover over variables and read tool tips messages which show the values of he variables. Some of the object variables will not appear tool tips, but you can temporarily insert MsgBox functions to read those if required. I suspect that the problem is related to the criteria in steps 1 - 3 that I previously posted, but would need to do the troubleshooting exercise to be sure and I don't have the file, and don't want them. If you can identify the problem, I will help you fix the code, but you will need to do the troubleshooting. You could try posting a new thread and see if some of those folks smarter than me can help. I would suggest that you post the code and screen shots of both sheets if you do start a new thread.
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,948
Latest member
UsmanAli786

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