How to duplicate a row in excel and paste it right below the original row?

Hello, can anyone kindly help me with this question? As shown in the image, I need to split the “role” into “teacher” and "volunteer. “teacher” will take the original row, and “volunteer” will be placed in the next row just right below. I will have over 500 records in a sheet, so I need to do this for every cell in the role column that contains “teacher, volunteer”.

@thedriedseaweed88
Welcome to the forum

We suggest to do it at DataTable Level and write it back

Different options:

  • Essential For each …
  • LINQ

Assign activity:
dtResult = yourOrigDT.Clone

Assign Activity
dtResult =

(From d in yourOrigDT.AsEnumerable
From s In d("Role").ToString.Trim.Split(",".toCharArray, StringSplitOptions.RemoveEmptyEntries)
Let ra = new Object(){d("Name"), d("Age"), s.Trim}
Select r = dtResult.Rows.Add(ra)).CopyToDataTable
2 Likes

Hello, thanks for your reply! How can I display the results? I tried out write range and stuff but I’m unsure of the destination to put the results in.

we would recommend to work with the debugging panels
e.g. immediate panel and write in the variable name of the resulting datatable

Understanding the 6 Debugging Panels of UiPath in the easiest way possible! - News / Tutorials - UiPath Community Forum

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