I have to read excel in two different datatables to avoid error while reading it. First dt is range A:M and second N:AO. Each dt has also empty rows and data needs to be merged/combined one next to eachother or added as new columns. Can someone give me vba code for this or something else to avoid writing to new excel. Thank you in advance
If you have the output datatable with the columns combined dt1 and dt2 you can use below LINQ to merge rows of two datatables side by side.
(From row1 In dt1.AsEnumerable()
From row2 In dt2.AsEnumerable()
Select dt3.Rows.Add(row1.ItemArray.Concat(row2.ItemArray).ToArray())).CopyToDataTable()