Assume I have two different excel. Below is the first excel,
And my second excel as below:
What I wanted to do is that, I will get the same ID between the two excel, then I get the “Status” value from first excel, and just write it back into the second excel, in “Status” column.
Just to clarify, do you want only those IDs which are present in both Excel Files, or do you want just the statuses from the First Excel to be pushed into the Status Column in the Second Excel File?
Got it, then could you please validate whether the extracted results are accurate?
(From r1 In dt1.AsEnumerable()
Group Join r2 In dt2.AsEnumerable()
On r1("ID").ToString.Trim Equals r2("ID").ToString.Trim Into gj = Group
From g In gj.DefaultIfEmpty()
Where Not IsNothing(g)
Select r1).CopyToDataTable()
(From row In dt2.AsEnumerable()
Let status = If(dict_statuses.Keys.Contains(row("ID").ToString.Trim),dict_statuses(row("ID").ToString.Trim),"")
Let ra = New Object(){row("ID"),row("Country"),status}
Select dt_result.Rows.Add(ra)).CopyToDataTable()