Filter Data Table and create new worksheet with the results

Hi, I have an excel file from where I have to filter some data and create a new excel worksheet with the results.
I am using the Workbook Append Range activity but I only need to pass a number of rows, not all the rows from the result filtered data table.
How can I just append a certain amount of rows to the new worksheet?

Hi @Allison_Cruz

You can use the datatable to filter the items just like this

YourDT dt = YourDT .select ( “[column] = 1”)

Use this for reference alternative ways:

Hope this will helpful. Thank you.

I kind of understand the point, but lets say the filtered data table throws me a total of 1000 rows, how could I just pick the first 8 to pass them to another workbook?

@Allison_Cruz Create a new data table variable (dt_new) which will save only 8 first rows. Try this: dt_new = dt_filtered.AsEnumerable().Take(8).CopyToDataTable. dt_filtered is the filtered data table.

1 Like

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