I have spreadsheet which is too large/slow (15-20k rows) to use a For Each. There are multiple columns in the spreadsheet (not all columns listed below) - sample image below.
Problem: I need to merge the column ‘FirstName’ and ‘LastName’ into a new column called ‘Name’.
(MiddleName doesn’t need to be removed as per the image)
Create a build datatable and add the columns you wanted in above diagram seems like Name and DOB and create a variable DT_BuildOutput
Checkout this expression
(From d In dt_Main.AsEnumerable()
Let f=d("firstName").ToString.Trim+" "+d("LastNAme").ToString.Trim
Select DT_BuildOutput.Rows.Add(f)).CopyToDataTable
(From r In dtInput.AsEnumerable
Let name = r("FirstName").ToString.Trim & " " & r("LastName").ToString.Trim
Let dob = r("DOB").tostring
Let ra = New Object(){name,dob}
Select dtResult.rows.add(ra)).copytodatatable