Hi everyone,
I have a datatable dt1 where columns A to K and M are populating correctly.
For Column L, it is based on Column K - Column B.
I did a For Each row to loop through row, taking Column K - Column B to give me a variable called Output where the variable type is Double. I have checked and confirmed that the value of Output for each row is correct.
I am stuck at how to update each row of Column L ("Outstanding Balance) with the corresponding Output value.
I tried
convert.ToDouble(dt1.Rows(row index).Item(“Outstanding Balance”).ToString) but it does not seem to work. E.g. whatever i try result in Column L being 0 for all when that should not be the case.
Please let me know if you have any suggestions on what I can check to populate this. Thank you! Really appreciate it.
This is the step that I do to get Output. I used the message box to print the output for each row and confirm that the amount is correct.
Next, I tried to assign Column L to output, where I did
IICodeSummary.Rows(rowInx_TotalAmt).Item(“Outstanding Balance”) = Output
where IICodeSummary is my datatable name, and rowInx_TotalAmt is the row index of my For Each loop as seen below:
Did you write back the datatable to your worksheet?
If yes, next can you try to set Breakpoint then check if content of the datatable: IICodeSummary is same what you expect at Locals panel?