Keep rows between value in datatable

hi i have a datatable of values

example:
| accounts | details | etc |
| 23617 | 23617 | 23617|
| asdas | asdasdsa | asdasda |
| asdas | efafsfa | erarr |
| 45636 | 45636 | 45636 |
| ijkasd | iwoei | asdjas |
| 45637 | 45637 | 45637 |
| ijkasd | iwoei | asdjas |

depends on the numerical, will need the rows below it

e.g. if 45636,
rows extracted should be
| ijkasd | iwoei | asdjas |

Hello @TyraS,

Use LINQ:-

Dim result = dt.AsEnumerable().
SkipWhile(Function(r) r(0).ToString <> “45636”).
Skip(1).
TakeWhile(Function(r) Not IsNumeric(r(0).ToString)).
CopyToDataTable()

1 Like

Identify target numeric row – e.g., 45636.

Initialize a flag (collect = False) to start collecting rows.

Loop through each row in the DataTable.

Check for target numeric value:

If found → set collect = True and skip this row.

Collect rows while flag is True:

Stop if next numeric row appears.

Otherwise, add row to a new DataTable.

Continue until the end of the DataTable.

Result – new DataTable contains rows below the target numeric row.

Hello @TyraS

Try below flow It will definitely work

ForumExcelFilteration_30_09_2025.zip (10.0 KB)

You will get output like this In dt_Row

This is current Row :
image

And the data after current row
image

Regards,
Rajesh Rane