I found a previous post (How to delete a row in excel based on condition - #3 by asatheeshk21) which was very useful but this deleted specific rows based on a criteria using the Assign functuion.
This used the statement
customerDT.AsEnumerable.Where(Function(x)Not(x(“Customer Details”).ToString.ToLower.Equals(“customer1”) or x(“Customer Details”).ToString.ToLower.Equals("customer1))).CopyToDataTable
Alas, I am not brilliant with functions but this works so well, I want to reuse it, but instead of removing the rows where Customer Details = Customer1 or Customer3, I want to retain those rows and delete everything else. I have tried a couple of things, but to no avail.
Could anybody assist please
Thanks