I want to copy duplicate data only which ID,R1,R2 column has duplicate value

Hi @Gaurav_Gore ,

We could perform Grouping of the rows based on the 4 columns as per the condition mentioned, and then we can capture the rows whose grouped Count is greater than 1 (2 or more), which would capture your required result.

Try the below :

  1. Assuming, Excel sheet is already read as a Datatable, say DT using Read Range activity.

  2. Next, we can create a Output Datatable by making a Clone of the Input DT like below :

OutputDT = DT.Clone
  1. Next, we can perform the Groupby and Filter only the Row Groups having count more than 1 (Duplicates).
OutputDT = DT.AsEnumerable.GroupBy(Function(x)New With{key .a=x("ID").ToString,key .c=x("R1"),key .d=x("R2")}).Where(Function(x)x.Count>1).SelectMany(Function(x)x).CopyToDatatable
  1. Next, you could write the OutputDT to an Excel sheet using Write Range activity.

Implementation :

For more on Linq Groupings :

Also, If there are no rows as Duplicates, you would need to handle it using the below method :