Excel - moving columns

Hi,

I need your help.

I presented the problem in the drawing. I need to put columns 1 and 2 under the data from column 0. I have no problem doing something like this but I don’t know how to automate Excel when I don’t know how many columns I will have.

Please help.

hi @Paulina,

What you are looking for is possible :slight_smile:

Please follow the following steps and let me know if you have any query in any of them:

  1. Read the whole table i.e. from column H to K
  2. You can check the count of column and put a for loop for that.
  3. Filter this data table, and keep the following columns
    Hardcode 1st column ie. 0
    and 2nd column will be the ( index counter + 1 )

This will save the column H and I, then H and J, then H and K and so on!!!

  1. Now merge the data table with property as ignore. This will be with the obtained DT from the filter DT.
  2. Now you can write this into an Excel.

Hope this helps :slight_smile:

Do let me know in case of any query. Please mark this as solution if it has solved your query :slight_smile:

Thanks,
Shubham

1 Like

Hi @Shubham_Varshney

I tried to do according to your instructions but something went wrong.

Main.xaml (10.2 KB)
excel.xlsx (8.6 KB)

I would be grateful for your further help.

Please find the updated xaml for reference.
Main (5).xaml (12.8 KB)

Thanks,
Shuabham

1 Like

Hi @Shubham_Varshney,

There is still a lot of learning ahead of me. Thank you very much!

1 Like

No worries, we in community are all there for you to help you out :smiley:

I’ll suggest if you get stuck, think on how to resolve it first by either searching or doing it yourself and then if you are still stuck then only post it in forum… :smiley:

This way you will read more ways to resolve :slight_smile:

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