Using VBA to update workbook B extracting data from workbook A

Rafaa

New Member
Joined
Aug 29, 2013
Messages
23
Hi,


In order to do the tests, I'm using 2 simplified workbooks (test_copy and test_paste).

What I'd like to be able to do, once I click a button UPLOAD (creating the button isn't the problem), is to go to the first cell from workbook test_copy, check if that code is already on test_paste and if not add it to the bottom of the list, repeating the same cycle for each code on the workbook test_copy.

The orders of the codes might change on both workbooks differently depending on the way the columns are sorted. That is why I believe that for each code in test_copy I need to check the entire column in test_paste to check if the code already exists.

At the end of the routine, on the example below, we would have the codes 2670, 2676 and 2626 added to the end of the list on test_paste.

test_copy

Excel 2012
A

<colgroup><col style="width: 25pxpx"><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2684[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]2783[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]2669[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]2670[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]2676[/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]2681[/TD]

[TD="align: center"]7[/TD]
[TD="align: center"]2601[/TD]

[TD="align: center"]8[/TD]
[TD="align: center"]2626[/TD]

</tbody>
Sheet1

test_paste

Excel 2012
A

<colgroup><col style="width: 25pxpx"><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: center"]2684[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]2783[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]2669[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]2681[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]2601[/TD]

</tbody>
Sheet1



Thank you very much in advance for your assistance.


Kind regards,


Rafael
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Rafaa,

Thanks for the feedback.

You are very welcome. Glad I could help.

And, come back anytime.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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