Check if value is grater than , using LINQ Query

Hello Everyone

I have data in excel i want to check if the number in each cell is grater then 1000,

if yes do something else something else.

How I can do that using LINQ query.

Thank you


Hope the following helps you.

dt.AsEnumerable.Any(Function(r) Double.Parse(r("ColumnName").ToString)>1000)


1 Like

Thank you @Yoichi , its working but what i am trying to do is , update the cell or coloring cell if the value is grater then 1000

like this



Can you try as the following?

arrInt = dt.AsEnumerable.Where(Function(r) Double.Parse(r("ColumnName").ToString)>1000).Select(Function(r) dt.Rows.IndexOf(r)).ToArray

Note: 2 is row offset value of the table.

Sequence.xaml (8.0 KB)


1 Like

Thank you , Working

1 Like

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