Write datatable column in excel row

I fetch the data table column and want to write it into the excel row with specific range. So i used write range activity:-

But bot is writing it in “K” column instead of row.

Hi @Jayesh_678

Do check the addheaders property

Thanks
Ashwin S

It is not working. My concern is to write the data in row with specific range.
Currently i am getting this output:-

But i want to write the data from “K2 TO CE2”

Hi @Jayesh_678

Have you tried using write cell activity

Thanks
Ashwin S

It is writing only single value. Not working.

You have a column of values and you want to write those in the row right?
You need to transpose the column and write it in each cell or

the simpler way is

  1. Use for each activity and loop through all the values in the column you have
  2. Use write cell activity to write each value in each cell you want to write
  3. Make the range dynamic to write in second row of each column

My write range is “K2:CE2”. How can i make it dynamic? Because here row number “2” is constant and letter is changing.

Yeah, you need to use another assign statement like

If index is less than 26
colToWrite = Convert.ToChar(64 + index).ToString

and if index is greater than 26
colToWrite = “A” + Convert.ToChar(64 + index - 26).ToString

if index greater than 52

colToWrite = “B” + Convert.ToChar(64 + index - 52).ToString

and so on.

Try to understand the logic here :slight_smile:

@Jayesh_678
have alook on this component:
https://go.uipath.com/component/excel-index-to-column

with help of this you can retrieve easy the EXCEL Column letter from the an integer e.g. the index from the for each activity