Filter Blank rows in Excel using Linq

You can give a try to this code.

Create two datatable. postedTable & notPostedTable.

postedTable = originalTable.AsEnumerable().
Where(Function(row) Not IsDBNull(row(“Posted”)) AndAlso row.Field(Of DateTime)(“Posted”) <> DateTime.MinValue).CopyToDataTable()

notPostedTable = originalTable.AsEnumerable().
Where(Function(row) IsDBNull(row(“Posted”)) OrElse row.Field(Of DateTime)(“Posted”) = DateTime.MinValue).CopyToDataTable()

Here row.Field(Of DateTime)(“Posted”) <> DateTime.MinValue : Ensures that the date is not the default DateTime.MinValue, which could represent an empty date.