Macro compare 2 excel files for matches and copy match + specified row columns from each file to current open sheet

joegotcha

New Member
Joined
Mar 2, 2014
Messages
1
Hello,

New to VBA and I've been looking around for a Macro to help me achieve this comparison of 2 Excel Files. I've found a useful macro that will allow me to pull complete rows but I'm having trouble changing it to only pull specified columns from matched cells.

I have 2 excels files, the first having only 1 sheet, multiple columns and a second file having multiple sheets and multiple columns of data that differs from the first File. The second file will have the same headers spanning multiple sheets but different variations in the columns.

From a 3rd Excel file on current sheet, I want to be able to run a macro that will compare Excel File 1 to Excel File 2, if it matches a cell, matched cell will begin to populate current opened workbook sheet starting from A3. If a match is made and it already exists on wb3 column A, I would like to consolidate the difference of the data into a list separated by commas (Data1, Data2, Data3). It will only occur from data in wb2 columns A & U that I have called out below.

From matched cell's row from wb1, copy column C to wb3 starting from B3.
From matched cell's row from wb1, copy column B to wb3 starting from E3.
From matched cell's row from wb1, copy column D to wb3 starting from E3.
From matched cell's row from wb2, copy column A to wb3 starting from C3. May have multiple different Data
From matched cell's row from wb2, copy column U to wb3 starting from D3. May have multiple different Data

Much appreciated for anyones input/help
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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