How to do filterdatatable reflection in same sheet

I want to remove specific rows in a column by filtering some row data.how to do that in a single sheet.how to filter the data in single sheet and remove the rest rows

Hi @anjani_priya

Can you Provide Input and Expected Output sheet

once you have told me the solution for this.I cant find that one.can you please tell that solution.
i have to filter the data of few row items and then i want to remove the hidden rows in it

Hi @anjani_priya

You can use the read range workbook activity to store the data in the datatable.
After read range workbook activity use the excel activities Clear sheet/Range/Table to clear the data in the excel.
After that you can use the Filter datatable activity to apply the filters in the datatable.
After filter you can use the Write range workbook activity to write the datatable to excel for the same sheet.

Check the below image for better understanding,

Hope it helps!!

Hi @anjani_priya

I Provided 2 solutions Earlier

Forum.zip (55.6 KB)
Forum.zip (76.4 KB)

Hope it helps!!

@anjani_priya

Thank you and Happy Automation.

Hi @anjani_priya

Use below expression

  1. Replace ColumnName of your DT
  2. Replace YourString from Yourvalue that you are matching on that column to remove rows.
    **It will remove that rows from you DT

DT.AsEnumerable().Where(Function(row) row.Field(Of String)(“ColumnName”) <> “YourString”).CopyToDataTable()

Hope it will helps you :slight_smile:
Cheers!!

how to keep filter for blanks

@anjani_priya

You can use below expression

DT = DT.AsEnumerable().Where(Function(row) row.Field(Of String)("ColumnName") <> "YourString" AndAlso Not row.ItemArray.All(Function(field) field Is DBNull.Value OrElse String.IsNullOrWhiteSpace(field.ToString()))).CopyToDataTable()

Happy Automation :slight_smile:

@anjani_priya
Share the Input excel

SampleCSVFile_2kb .xlsx (8.5 MB)
Book1.xlsx (1.7 MB)
as odn refernce get the date and acknowlegment from sample to book1
how to vlookup for this huge data

@anjani_priya

Sure,But
Don’t continue a topic in the same question.Try to open a new topic

already i have opened but no one responded

1 Like

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