How change the format in excel?

Hi Team,

I got a use case that after extracting the data table from the website I need to change the format the format looks like below.

Column name: Balance

Here I need to do the format like

How to do the format in UiPath Can anyone help me?

Chethan P


Please use format cells activity from excel activities which hs an option to set the format and you can set as number


Yes, we can do that in the extraction data part we have a setting to convert to numbers but I need “-1234.23” subtraction symbol is needed.


Ideally number would convert the bracket values to minus in the excel

if not you can use custom and give this format #,##0.00_ ;-#,##0.00


Can you please explain how to use this I am not getting

Hi @copy_writes

  1. Use the Read Range activity to extract the data table from the website and store it in a variable, let’s say dtData.
  2. Add a ForEach Row activity and set the Input property to dtData.
  3. Inside the loop, add an Assign activity to modify the format of the “Balance” column.

Assign activity:
Left side: row(“Balance”)
Right side: “-” & Math.Abs(Double.Parse(row(“Balance”).ToString())).ToString(“#0.00”)

The above expression converts the value of the “Balance” column to a Double, takes the absolute value, adds a “-” sign, and formats it with two decimal places.
4. After the ForEach Row activity, you can use the modified DataTable dtData, which now has the “Balance” column values in the desired format.

Hope it helps!!

I am getting an error when I am run this code.

Try this

  1. Read Range

    • Input: Website Data Table Range
    • Output: dtData (DataTable)
  2. For Each Row

    • Input: dtData
    1. Assign
      Left side: row(“Balance”)
      Right side: “-” + Math.Abs(Convert.ToDecimal(row(“Balance”)))
  3. Write Range

    • Input: Destination Excel File Path
    • Input: dtData

I Am getting an error

can you share sample input file? it will be better

Give a try
By Storing the row(“Balance”).tostring in the variable and pass here in the to: of assign


This is how you can do it



What is the range we have to give in the Source field?


If you want one full column to be changed then Excel.Sheet("Sheetname").Range("H:H") this for whole H column


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