Compare two columns of data and Copy/Paste info from one workbook to another

msigman

New Member
Joined
Mar 20, 2015
Messages
1
I have two workbooks (“Master” and “Weekly”). The weekly file will be different each week.</SPAN>
Columns A thru D have the same information in both files. The Unique ID for both is in Column A.</SPAN>
First, I prompt the user to open the Weekly File (when they have the Master file already open). Then I create four new columns at the end of the Master file (using the date from the Weekly file in the headers).</SPAN>
I need the rest of the macro to do the following:</SPAN>
I want to compare the values in Column A from the Weekly file against the values in Column A on the Master file. If the value is found in the Master, I want to copy and paste info from columns L, N, P, and R in the Weekly file into my four new columns in the Master file.</SPAN>
If the value from the Weekly file is not found in the Master I want to put it at the bottom of the Master list, copy and paste info from columns B thru D from the Weekly to the same columns in the Master file, and copy info from columns L, N, P, and R in the Weekly file into my four new columns on the Master file.</SPAN>
I then want to sort the Master file by the Unique ID in Col A.</SPAN>
I have some code but it is very clunky and only does part of the look-up and adding if the value already exists.
Any help would be greatly appreciated.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Forum statistics

Threads
1,215,133
Messages
6,123,234
Members
449,092
Latest member
SCleaveland

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