How to move row items to column(Transpose) in excel using UiPath

Hi, I came across a scenario where I needed to move row values to column /, in other words, transpose. In another similar thread, I found a package that does the work, but I want to learn to make it happen without the use of packages and do it a hard way, can anyone help me with this?

Thank you.

Refer this video

HI @sangeethaneelavannan1

Thank you, I have seen this video, but it’s very confusing, I had to close the video after a while, the flow of his explanation is confusing as he was using an already created variable and not creating the one on the go, it’s hard to catch up on that one.

A clean text explanation with steps would be really helpful.

Thank you.

Hey Rajesh,

here is an easy way to transpose row values to columns.

Assuming you already have a datatable (lets call it dt_source) with one column of relevant values, which you want to transpose to columns.

  1. Initialize a new empty datatable (for transposed values, lets call it dt_target)
  2. Iterate through dt_source with a For Each Row activity
  3. Inside the For Each Row Body insert an Add Data Column activity
  4. Fill the properties with the target datatable (dt_target) and the ColumnName (that would be the row(“value”) to be transposed)
  5. That’s it, you’re done. Write Range (dt_target) to Excel to inspect your results.

Happy automating

1 Like

Hey @lukasziebold,

Thanks a lot, sorry for the delayed response I was caught up with something else, I will try this out and let you know shortly.

:grinning_face_with_smiling_eyes:

Update: it Worked!
ExcelTranspose.zip (43.7 KB)

1 Like

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