How to Filter Excel Data by Today's Date

Hello,

I have not done this using the FilterOptions but you can use an Assign activity to set an array of rows or datatable that meets your criteria.

Here’s an example,
arrayRows = dt.AsEnumerable().Where(Function(row) cdate(row(“column”).ToString) = Now).ToArray()
or
dtNew = dt.AsEnumerable().Where(Function(row) cdate(row(“column”).ToString) = Now).CopyToDataTable()

The difference of the two examples are that an array of rows let’s you update values and it updates to the original datatable, whereas if you copy to a datatable then you are changing the values in the new table.

Note: if your date is in the format dd-MM-yyyy, where month is after day then instead of cdate() use ParseExact which can be found elsewhere on this forum.

You can research more into this method by searching with keywords like vb.net, LINQ, or lambda.

Good luck!

1 Like