I have this manual process. Shown files above are the Source.xlsx and Actual.xlsx.
First step: Copy the highlighted rows from Source.xlsx where the basis is the current date or today’s date. Then paste the highlighted rows to the Sheet1 of the Actual.xlsx (highlighted in Yellow)
Second Step: In the Actual sheet of Actual.xlsx, apply this VLookUp Formula: =VLOOKUP(@C:C,Sheet1!E:F,2,0) in the column beside the Reference Number (highlighted in green)
May I ask for help to know what is the most efficient way to automate this one even if it is composed of thousands of rows? Can we implement LinQ instead of VLookUp formula and generate the same output efficiently?
Kindly see attached files for Source.xlsx and Actual.xlsx. Thank you.
For Each row1 As DataRow In dt_Actual.Rows
Dim ReferenceNumber As String = row1("Reference Number").ToString()
Dim foundRow As DataRow = dt_Source.AsEnumerable().FirstOrDefault(Function(r) r(4).ToString() = ReferenceNumber)
If foundRow IsNot Nothing Then
row1("New Col") = foundRow(5)
End If
Next
Hi @V_Roboto_V@lrtetala@mkankatala thank you so much for your help. I’ve unchecked the Add Headers in the Read Range for Source.xlsx and Write Range for Actual.xlsx. Thank you.