Remove Data Rows from Data Table

Hi,
i want to delete datatable row below mention example table except header and 1 row.

Thank you.

Hi @MD_Farhan1

Try this linq query:

dt = dt.AsEnumerable().Take(1).CopyToDataTable()

Regards

Hi @MD_Farhan1

While using the write range please check that by writing to a new sheet.
Please check the below flow:
WorkFlow:
Main.xaml (13.1 KB)

Input:

Output:

Regards

@MD_Farhan1

dt = dt.AsEnumerable().Take(1).CopyToDataTable()

use this expression

or please let us know is there any condition for you to get only specified row

I Got Error

Read Range Workbook: The identifier Table1 was not recognised

1 Like

Hi @MD_Farhan1

Can you please share the error screenshot?

Regards

Excel Application Scope need for this?

Hi @MD_Farhan1

No application scope is not required please check the xaml i have attached in the above reply.

Regards

i don’t use application scope this one is not Range this one is table table name table1.

Hi @MD_Farhan1

Please try with the invoke vba. I have updated the code in the below attached xaml please check.
Main.xaml (18.0 KB)

Code Text.
ForumText.txt (721 Bytes)

Regards

Thank You so much bro :+1:

Hi @MD_Farhan1

You’re Welcome bro

Happy Automation!!

1 Like

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