Dear Developers, i have a question regarding Excel where i have to get to sum up until until current row in column A and populate that in column B. sample as per below
i have to sum up to current row in column A and populate that in column. i believe we can use write cell and =sum(current cell:Beginning cell) to get the sum… but is there a faster way since there will be lots of rows involved
(From i in Enumerable.Range(1, dtData.Rows.Count)
Let s = dtData.AsEnumerable().Take(i).Sum(Function (x) CInt(x("Column1").toString.Trim))
Select ra = new Object(){s}
Select r = dtSum.Rows.Add(ra)).CopyToDataTable