Add column in data table relative to another column

I have a data table in an excel spreadsheet with column headers. I need to insert a coulumn immediately after one of the existing columns in the data table.

There is the potential that the column positions in the excel spreadsheet/data table may change, but I want to prevent having to recode if that is possible

As an example I have a data table with e-mail address (at column 4) and need to insert a blank column after the e-mail address (at column 5)
If the underlying data that produces that data table changes, and the e-mail address is now at column 3, I need to be able to insert my new column at column 4 (after e-mail address) and not at column 5

Thanks for your assistance

Hi @gary.cobden,

If your column have names and are consistent, you might be able to use that to get the position of the column.

The topic below has a solution but it is C#.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.