Dynamic copying of data, concatenating and pasting of the data in specific cells

Hello Everyone!! Please I need your help.

I want to copy some data from a column J starting from a specific cell, and concatenate it data from another Column L starting from a specific cell, and save the results of the concatenated data to column U starting from a specific cell. Please note that all this is done dynamically. So the starting cell for column J, L and U is the last row index +1 for column P. Again please note that the number of rows in column p is different from the number of rows in column J, L and U. for instance column P might have 700 rows while others have 3000 rows, though this is not always the case as the number and position of rows vary daily. so the nos of rows are not static its always dynamic, but the starting row to copy data and concatenate for both column J and L is always the last row +1 of column p and the starting row to paste concatenated data on column U is the last row +1 of column p

try below steps

1.Use excel scope
2.use excel file
3.filter on the p column with empty condition using filter activity
4.use for each excel row activity
5. in for each use write cell give value and address by using currentrow property

Hope the above flow will work for your use case


1 Like

Hi @Lamina_Zafrullah

Try this-

  1. Use the “Excel Application Scope” activity to open the Excel file.
  2. Use the “Read Range” activity to read column P and store the output in a DataTable variable. Then, use the “Assign” activity to get the last row index by using dataTable.Rows.Count.
  3. Use the “Assign” activity to set the starting row index for columns J, L, and U as lastRowP + 1.
  4. Use the “For Each Row” activity to iterate through each row from the starting row index until the end of the data in columns J and L.
  5. Inside the loop, use the “Assign” activity to concatenate the data from columns J and L and store it in a variable.
  6. Use the “Write Cell” activity to write the concatenated data to column U in the corresponding row.


Hi @Nitya1

Thanks for your response. Can you please elaborate on steps 4 and 5 and guide me on the step-by-step process? Like, how do I iterate from the starting row index to the end row index?

Thank you as I await your response.