I have two tables and am trying to figure out how to create custom code to add dynamic columns with custom names that are based off of row values in another table. I then need to use the values of rows in Table 2 to not only create the column names but also fill the new dynamic Columns with a value from another column in Table 2. Hopefully my pictures below help
Table 1 has varying amount of rows depending on what the user input. Table 2 has varying amount of rows depending on how many values the user inputs.
Table 1 Before
| Col1 | Col2 | Col 3 |
|---|---|---|
| stuff 1 | stuff 2 | stuff 3 |
| stuff 4 | stuff 5 | stuff 6 |
| . | . | . |
| . | . | . |
Table 2
| Name | Values |
|---|---|
| Name1 | 100 |
| Name2 | 500 |
| . | . |
| NameX | Y |
Table 1 After
| Col1 | Col2 | Col 3 | "Column" & Name1 | "Column"& Name2 | ... | "Column"& NameX |
|---|---|---|---|---|---|---|
| stuff 1 | stuff 2 | stuff 3 | 100 | 500 | ... | Y |
| stuff 4 | stuff 5 | stuff 6 | 100 | 500 | ... | Y |
| . | . | . | 100 | 500 | ... | Y |
| . | . | . | 100 | 500 | ... | Y |
The "Column" & Name1 meaning I want to concatenate Column with the values in the Name column in Table 2.

