How to read 1 row or multiple rows from one excel sheet and write it in another excel sheet

@sundeeperanti asiest and most understandable way to code is to simply use a for reach row loop and check if the data in column CC is blank. If it is blank, import the row to a second datatable. After the for each row loop is completed, your second datatable will contain copies of all the rows that had blank data, so you can write it into the new sheet using a write range activity.

  1. Read Range activity on excel sheet like you show in example // i’ll call this dt1
  2. Assign activity - Assign dt2 = dt1.clone // This copies the structure/schema of dt1 into another datatable variable called dt2
  3. For each row in dt1
    3a. If String.IsNullOrWhiteSpace(row.item(“CC”).ToString)
    3b. Then (true side) Import row - see this post for pics and explanation on how to do this with Invoke Method activity: Copy Row from one DataTable to another - #2 by UiRobot
    3c. Else (false side) - leave false side blank
  4. Write range activity - write dt2 into your new sheet
3 Likes