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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Wongjiaxin

New Member
Joined
Feb 11, 2020
Messages
3
Office Version
  1. 365
Platform
  1. Windows
  2. Web
For different header, for example, the header in sheetname1 is contract no., but in sheetname2, the header is policy number. They have actuallysame meaning.
 

Watch MrExcel Video

Forum statistics

Threads
1,130,245
Messages
5,641,073
Members
417,192
Latest member
choomkey

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
Top