EXCEL Move ROWS based on condition

Hello everyone!
Here is my issue,

Based on Condition on 1 Column, how to move whole row to the end of the sheet, having a separation of 1 empty row (For Identification)

Col Name: RRN
Condition value: Settlement

for Column “RRN” consisting of “Settlement”, move these rows to end of sheet ,leaving a row as separation

kindly provide solution for this

@nidhi.kowalli

  1. Use Read Range activity to read the data from Excel file and it will give output as DataTable. Let’s say ‘InputDT’.

  2. And then use below expression to filter the data.

      outputDT = InputDT.AsEnumerable().Where(Function(row) row("RRN").ToString.Contains("Settlement")).CopyToDataTable
    
  3. And then use Write Range activity and pass outputDT to it and also mention Range as below.

        "A"+(InputDT.Rows.Count+2).ToString
    

Its not moving the rows!

This soliton is Copying the rows and pasting at the end of sheet

@nidhi.kowalli

Yes it won’t move the rows.

You can do one thing create one new excel sheet. And find out the rows whose Column value contains Settlement and not contains Settelment from input DataTable and write both DataTables separately into the new sheet.

1 Like

Thank you!!

This worked!

1 Like

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