I have two sheets: the first with data with column headers as 'Line#s' I need to change based off of a lookup table on the second sheet. Both tables have an overall category (ID) and sub-category (Type). The header names in the lookup table vary depending both categories. I need a condition statement to choose the correct value that looks at the category values and make sure they match. My first table looks something like this:
<tbody>
</tbody> The lookup table is large with values for multiple ID's and Types like follows:
<tbody>
</tbody>Therefore the result should find the corresponding gas name for the Line # and replace it looking like this:
<tbody>
</tbody>
The incoming data usually has a single ID with multiple types but I have acquired code to break up the data into multiple sheets each with one ID and one Type to make the column header change valid.
Help would be tremendously appreciated! I am new to VBA and do not understand the language
ID | Type | Line13 | Line17 |
421 | B | 123 | 234 |
421 | B | 456 | 124 |
<tbody>
</tbody>
ID | Type | Line # | Gas |
421 | A | 13 | H2O |
421 | A | 17 | CO2 |
421 | B | 13 | H2 |
421 | B | 17 | CO2 |
421 | C | 17 | O2 |
556 | A | 13 | N20 |
556 | B | 13 | H2 |
556 | C | 13 | CO2 |
<tbody>
</tbody>
ID | Type | H2 | CO2 |
421 | B | 123 | 234 |
421 | B | 456 | 124 |
<tbody>
</tbody>
The incoming data usually has a single ID with multiple types but I have acquired code to break up the data into multiple sheets each with one ID and one Type to make the column header change valid.
Help would be tremendously appreciated! I am new to VBA and do not understand the language