How can i change the order column in excel

How can i change the order column in excel

could you please explain with some example…

1 Like

Hi @prasath17

I have an excel file with 50 columns but i want the column 48 be in the 3th place not in the 48th place

Hi @Soudios

If you want to rerder column we can do like this,

  1. Read the excel sheet data in the datatable variable name dt.

  2. Use set ordinal method using invoke method and change the column order,

Refer the below link for how to reorder column in datatable.

If you know the column name give the name else give the column index as dt.columns(47) (it’s referring 48th column as column index starts with 0)

In parameter create a argument and give value as 2.

  1. Write the data back into the excel using write range activity and pass the datatable dt.

Thanks

1 Like

hi @Soudios - Please check here for reference…In your case, you don’t need the “Add Data Column” activity…

You can straightaway use the Invoke code with the columnName(Replace with “Split”) and Set your parameters as Int32 as 3.

1 Like

Hi @Soudios

Here you go with an xaml sample

Cheers

1 Like

@prasath_S
Thank you !

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