Please help to get the last row none empty value in specific Column(PO Number) -Sheet1 and compare with last none empty row in specific Column(PO Number) -sheet2 if both are same it should prompt validation success.
You’ll read each sheet in a dataTable → sheet1Table and sheet2Table
Assuming you’ll have strings, assign to 2 variables the last value like this
dim var1 as string = sheet1Tabled.AsEnumerable.Where(function(x) not String.IsNullOrEmpty(x.Field(of string)(“PO Number”).ToString)).Last().Item(“PO Number”).ToString
The same for the last value from the second sheet
dim var2 as string = sheet2Tabled.AsEnumerable.Where(function(x) not String.IsNullOrEmpty(x.Field(of string)(“PO Number”).ToString)).Last().Item(“PO Number”).ToString
Then you’ll just have to compare them
If you’ll get an error, change maybe from string to integer or double at "field(of string)"