VBA help to match column header from different workbooks

Wongjiaxin

New Member
Joined
Feb 11, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi all,
I am looking for some VBA code to help me with the problems, it would be great if one can help.

I have 2 workbooks, and there are multiple worksheets in each of these workbooks. In workbook2(sheetname1) I would like to find the column in workbook1(sheetname2) that has the corresponding header, and copy all the data in the column and paste into correct column on sheetname2. I would like to do this for all columns in sheetname2. and there might have some different headers names in sheetname2 but they actually have the same meaning as the headers in sheetname1, and i want to copy the data below those headers to corresponding headers in sheetname2 too.

Can anyone help me? Thank you.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
For different header, for example, the header in sheetname1 is contract no., but in sheetname2, the header is policy number. They have actuallysame meaning.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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