Delete row in excel?

Hello, Now I use code as below.

dt.AsEnumerable().Where(Function (row) row(“ID”).tostring.Length < 5 or row(“ID”).tostring = “Test”).CopytoDatatable

IF I want to delete row that match condition in excel. (Exclude header)

Please guide me for solve it.

Thank you.

Hi @Stef_99

filteredDT = dt.AsEnumerable().Where(Function(row) row("ID").ToString.Length >= 5 AndAlso row("ID").ToString <> "Test").CopyToDataTable()

@pravallikapaluri How to delete data row in file excel?

@Stef_99

Use Delete rows activity

@Stef_99

If you want to use linq query you need to write the result in another excel sheet.
Use delete rows activity in excel application scope in excel activities.

Hope it helps!!

1 Like

@pravallikapaluri I have question
How to delete row that column ID length >=5 or column ID = Test?

@Stef_99
If you want to delete the rows using excel activities. need to use macros code

1 Like

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