Map column headings with different spelling/naming then find/copy column from one sheet to another

jwb1012

Board Regular
Joined
Oct 17, 2016
Messages
167
Hello, I am in a bit of a strange predicament, where the column headings on my system A generated report do not match the column headings that I NEED on my import sheet for system B. Also, the system A generated report has additional columns that I don't need.

I have two worksheets...
  • "2 - Report" - which has the system A generated report with different heading names AND additional columns.
CategoryLocationIDDateQuantityCurrencyUnit PriceTotal Price
AAAAAA00000115-Mar-201720USD$8.01$160.20
BBAAAA00000215-Mar-201720USD$40.04$800.80
CCAAAA00000315-Mar-201720USD$80.08$1,601.60
DDAAAA00000415-Mar-201720USD$160.15$3,203.00
AAAAAA00000128-Mar-201725USD$7.85$196.25
BBAAAA00000228-Mar-201725USD$39.24$981.00
CCAAAA00000328-Mar-201725USD$78.48$1,962.00
DDAAAA00000428-Mar-201725USD$156.95$3,923.75

<tbody>
</tbody><colgroup><col span="8"></colgroup>





  • "3 - Import" - which I need in the format shown below. THE HEADINGS** are already on this sheet, but there is no data. This will be imported into System B.

CategoryIDTXN_DateTXN_Quantity TXN_Unit_Price TXN_Total_Price
<insert data><insert data><insert data><insert data><insert data><insert data>
<insert data><insert data><insert data><insert data><insert data><insert data>
<insert data><insert data><insert data><insert data><insert data><insert data>
<insert data><insert data><insert data><insert data><insert data><insert data>
<insert data><insert data><insert data><insert data><insert data><insert data>
<insert data><insert data><insert data><insert data><insert data><insert data>
<insert data><insert data><insert data><insert data><insert data><insert data>

<tbody>
</tbody><colgroup><col span="6"></colgroup>



To solve this issue, I would like to use a lookup table (shown below) to set the required headings equal to system A headings, then find the column where the system A headings are located on the "2 - Report" worksheet, and then copy that column to the "3 - Import" worksheet.

Any thoughts on how one can do this with VBA?



System A HeadingsRequired Headings
CategoryCategory
IDID
DateTXN_Date
QuantityTXN_Quantity
Unit PriceTXN_Unit_Price
Total PriceTXN_Total_Price

<tbody>
</tbody><colgroup><col span="8"></colgroup>
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

Forum statistics

Threads
1,215,054
Messages
6,122,901
Members
449,097
Latest member
dbomb1414

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