Change Excel's column type

Hi guys. I ve a problem. I ve three columns in my datatable. I used the formula for the sum of columns A and B to create column C. So I wrote =A+B in the first row of column C and applied it for all rows. However, due to another problem I’m having, I need to store the numbers in column C as numerical values instead of formulas. For this reason, I used the “Copy Paste Range” activity. But when I type the CopyItems option as Value in this activity, there is a Monetary value. I want to buy it as a double instead of a monetary value. How will I do it? I dont want to use for each

Hi @Ali_Osman_Kaya ,
You can format cell after finish write


regards,

1 Like

I got an error. "Activity is valid only inside the “Use Excel File”. But ı used excel application scope

Hi @Ali_Osman_Kaya ,
You need read more about it
https://docs.uipath.com/activities/other/latest/productivity/format-range-x
it need inside ‘Use excel file’

image
and


you need change format, your path file, your range,…
regards,

@Ali_Osman_Kaya

Try this Linq

yourDataTable.AsEnumerable().ToList().ForEach(Sub(row) row.SetField(Of Double)(“C”, CDbl(row(“C”))))

Cheers…!

@Ali_Osman_Kaya

yourDataTable.AsEnumerable().ToList().ForEach(Sub(row) row(“C”) = CDbl(row(“C”).ToString().Replace(“$”, “”).Replace(“,”, “”)))

cheers…!

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