kevinh2320
Board Regular
- Joined
- May 13, 2016
- Messages
- 61
I have two worksheets in my workbook. Sheet1 contains customer order information with column A holding their account number. Sheet2 contains customers name & address information with column A also holding their account number. I need VBA code to start at cell A2 of sheet1 and check the account number. Then move to Sheet2's column A to see if there is a matching account number. If there is a match copy cells "B" through "F" of that row, then return to that accounts row in Sheet1 and paste the Company Name, Address, City, State, ZipCode in cells F through J of that row. Code needs to loop through the entire column A of sheet1 until complete. If there are account numbers that don't match code should just move to the next row until complete.
Hope this make sense. Example sheets 1 & 2 shown below. Thanks for any help.
<colgroup><col style="width: 107px"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>
</tbody>
Sheet2 Example
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
<colgroup><col style="width: 107px"><col width="163"><col width="132"><col width="100"><col width="100"><col width="100"></colgroup><tbody>
</tbody>
Hope this make sense. Example sheets 1 & 2 shown below. Thanks for any help.
Sheet1 Example
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>Acct# | Part# | Qty | UnitPrice | Ttl |
123456 | 544 | 15 | $175.00 | $2,625.00 |
133987 | 443 | 35 | $100.00 | $3,500.00 |
239395 | 434 | 66 | $5.00 | $330.00 |
102102 | 444 | 33 | $55.00 | $1,815.00 |
239395 | 544 | 9 | $85.00 | $765.00 |
433202 | 132 | 94 | $35.00 | $3,290.00 |
103111 | 444 | 150 | $55.00 | $8,250.00 |
244365 | 333 | 50 | $100.00 | $5,000.00 |
411555 | 444 | 17 | $55.00 | $935.00 |
244987-A | 233 | 1543 | $1.50 | $2,314.50 |
<colgroup><col style="width: 107px"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>
</tbody>
Sheet2 Example
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
Acct# | CompanyName | Address | City | State | ZipCode |
123456 | ABC Company | 123 Lost Ln | Seatte | WA | 98555 |
102102 | Hawk Industries | 3600 W. 2nd Ave | Kent | WA | 98366 |
103111 | J&J Co. | P.O. Box 10 | Kirkland | WA | 98111 |
133987 | Snip & Clip | P.O. Box 25 | Tacoma | WA | 98232 |
244365 | Performance Max | 434 Anywhere Pl | Sometown | WA | 98765 |
239395 | Joe Joe's | 765 Where St. | Anytown | WA | 98767 |
239395 | Automax West | P.O. Box 15776 | Lost City | CA | 92888 |
244987-A | Tudle Row | 6434 Salem St. | Tacoma | WA | 98232 |
433202 | Brewmiesters Cache | 101 Whiskey Pl. | Redmond | WA | 98664 |
411555 | J. Co. | 888 Maple St. | Tukwilla | WA | 98334 |
388998 | BnB Traders | P.O. Box 7 | Anchorage | AK | 99510 |
325463 | CC Co. | 1243 Made Up Ln. | Seatte | WA | 98765 |
333321 | Music World | 555 5th Ave. | Edmonds | WA | 98768 |
383009 | Pets and Pamper | 4787 3rd St. | Kent | WA | 98366 |
520020 | Industrial Supply Inc. | 88457 54th Ave. | Ballard | WA | 98444 |
500011 | Recreational Adventures | 232 Easy St. | Seatte | WA | 98437 |
655837 | Zip Deliveries | 343 4th Ave | Mt. Vernon | WA | 98876 |
299534-B | Green Thumb Landscaping | 400 Cherry Dr. | Lynnwood | WA | 98554 |
<colgroup><col style="width: 107px"><col width="163"><col width="132"><col width="100"><col width="100"><col width="100"></colgroup><tbody>
</tbody>