Overwriting Excel cell values from values in data table

Hello there,

I am reading an excel worksheet into a data table having multiple columns. I am then applying TrimStart to remove leading zero’s from each cell. I then want to update each cell of the column with the trimmed value. Please not that the excel rows are dynamic and dont know the number of rows each time it gets updated.

I am using Write cell activity to update the new value into each cell. Currently, this is not working. After debugging it I found the values are getting trimmed currently and there are no run time errors while executing Write Cell.

Any help would be much appreciated. Thank you

image

Hi @rohankulkarni please try clearing the pre-existing cell values and then pasting new cell values.

Hi @rohankulkarni,

One solution could be to iterate thru each row/column from a read datatable, and overwrite the read value as follows:
readDT.Rows(readDT.Rows.IndexOf(row))(col.ToString) = readDT.Rows(readDT.Rows.IndexOf(row))(col.ToString).ToString.TrimStart

Something like this it should look like:

This is the file where I’ve tested the solution
OverwrittingCellValue.xaml (6.4 KB)

Hope this helps
Best regards,
Marius

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.