Add dynamic rows to excel

Dear members,

I have an excel as attached, the value for column A is a fixed value, will lookup some values(the number row of this values are dynamic) in website according to column A’s value, then add to Column B.

That means Column A to Column B is 1 to more. How to insert a dynamic rows?

Thanks very muchtest.xlsx (10.6 KB)

@li.yu

Does Column A contain unique values?

Read this topic, it will be useful while designing the workflow

Thanks Kumar, but it seems can’t solve my problem, my case is for example, use For each Row,

the first time, if there are 4 rows need to be updated in Column B according to the search result from “3456”, I need insert 3 rows, insert from row 3. see picture 1 1

While the second time, if need to update 3 rows in Column B according to the search result from “854”, I need to insert 2 rows, insert from row 7, see picture 2. 2

While the third time, if need to just update 1 row in in Column B according to the search result from “5678”, I need to insert 0 rows, see picture 3.3

My quetion is how to get the value of “insert from row xx?”

@li.yu

  1. Read Input Excel File → Read Range → inputDT
  2. Make another Data Table → outDT → inputDT.Clone
  3. For Each Row in inputDT → search result for Row(0)
    Iterate through the search result-> Add Data Row in outDT with first column value as Row(0) and second column value as search result first value. Continue for the other search result
  4. Perform the operation for all Rows of inputDT

Finally write the outDT to an excel file-> Write Range

yes, I did it like this, created a new data table instead of inserting on the original one.
Thanks!

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