Change excel column in Number Format

Hi All,

Could you please help me to convert excel column in to Number format with 0 Decimal.

Is there any activity for that? If it is please mention Package name too

Thank you,
KeshAV

Please Try Below :

  1. Read Range of the sheet , this will give you a DataTable.
  2. Take a Write Range and Write Datatble in a new Sheet . This will remove all Formats.

OR

If the above Fails :

  1. Read the sheet in a DataTable.
  2. Iterate the DataTable in for each -
  3. Inside For each : assign row(“ColumnName”) = Convert.toInt32(row(“ColumnName”))


Mukesh

1 Like

Hi Mukesh,
Thank you for responding. But both the solution is not working. in second one if I use int32 it is throwing error ,(Its too large or too short) and once I am using Int64 its compliling but not converting. Its same as it is.

okay -

Can you try converting to Double and then truncating the extra decimals ?

1 Like

Hi Mukesh,

Whatever convertion I am using It is showing same.

Here it is the screenshot, I have this one-
Format
And I required below:-
Required

Thank you

Can u please provide the complete value in the cell : 4.06E+11 ? I will try reading it

Test_File.xlsx (8.4 KB)

Hi Please find attached file.

Thank you,
Keshav

Its is in General Sample Format. And We need to Convert Number Sample format with decimal 0.

@keshav,
Please Have a look - I am able to get the Below values - Is this what is required ? … please Correct my understanding here.

image


Mukesh

Yeah… But when we will write in excel It’s not coming in this format. It is showing as it is. Please try to write in Excel you will get .

Thanks,
Keshav

Hi ,

I am Looking at the excel . Let me have a look.

HI @keshav,

To change the format cells you can use the below activity.

Thank you
Balamurugan.S

1 Like

Hi Bala,
Thank you for your response.
I am using 2018.4.1 version. Is there any way to achieve that in this version.

Regards,
Keshav

1 Like

I think . it can work. Make a try.

Thank you
Balamurugan.S

Hi Bala,

Its not working. When I am Writing to excel it is showing same as it is.

Regards,
Keshav

hi @keshav ,

I found an WorkAround,

Inside the Excel Application Scope , If we Select the Data ans Send Hotkey : Ctrl+Shift+1 ,
I got the Below Output.
image

Now , Here We can try with Different Keys : Ctrl+Shift+1 or Ctrl+Shift+2 or Ctrl+Shift+3 and So on … Use the One which suffice your Requirement.

I would Suggest First Manually Open the Excel , Select the Row with Data and try these Keys Ctrl+Shift+1 or Ctrl+Shift+2 or Ctrl+Shift+3 . Post This - Implement that in Uipath.

Below is a Sample I worked with : Ctrl+Shift+1

Below are the Links I followed to get the Shortcuts :


Mukesh

Ok @mukeshkala I will try to use Send hot key fro my requirement.

Thank you for you help

1 Like

Hi @keshav,

Hi ,

Here I have attached the sample for you with screen shot.

Input :

image

Output :

image

Workflow :

Sample :

keshav.zip (31.5 KB)

Regards
Balamurugan.S

1 Like

Thank you Bala… Is it possible to convert format in same column in that same excel file ??how we are doing manually, Once I am giving same path its throwing an error.

Regards,
keshav

Hi @keshav,

Yes. you can try with same file … My community is the latest version . it is give more trouble. I don’t have to report and resolve it. Can you try with Cell property to give the value as “A:A”…

Thank you
Balamurugan.S