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...
<tbody>
</tbody><colgroup><col span="8"></colgroup>
<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?
<tbody>
</tbody><colgroup><col span="8"></colgroup>
I have two worksheets...
- "2 - Report" - which has the system A generated report with different heading names AND additional columns.
Category | Location | ID | Date | Quantity | Currency | Unit Price | Total Price |
AA | AAAA | 000001 | 15-Mar-2017 | 20 | USD | $8.01 | $160.20 |
BB | AAAA | 000002 | 15-Mar-2017 | 20 | USD | $40.04 | $800.80 |
CC | AAAA | 000003 | 15-Mar-2017 | 20 | USD | $80.08 | $1,601.60 |
DD | AAAA | 000004 | 15-Mar-2017 | 20 | USD | $160.15 | $3,203.00 |
AA | AAAA | 000001 | 28-Mar-2017 | 25 | USD | $7.85 | $196.25 |
BB | AAAA | 000002 | 28-Mar-2017 | 25 | USD | $39.24 | $981.00 |
CC | AAAA | 000003 | 28-Mar-2017 | 25 | USD | $78.48 | $1,962.00 |
DD | AAAA | 000004 | 28-Mar-2017 | 25 | USD | $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.
Category | ID | TXN_Date | TXN_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 Headings | Required Headings |
Category | Category |
ID | ID |
Date | TXN_Date |
Quantity | TXN_Quantity |
Unit Price | TXN_Unit_Price |
Total Price | TXN_Total_Price |
<tbody>
</tbody><colgroup><col span="8"></colgroup>