cancel
Showing results for 
Search instead for 
Did you mean: 

Text to Number

RishabhChauhan
Level 3
Hi All,

Anyone knows how to perform Text to Number conversion in excel using Blueprism?
Is spying the best approach?

------------------------------
Rishabh Chauhan
------------------------------
1 BEST ANSWER

Helpful Answers

Hi @RishabhChauhan,

You can use the below code for performing the conversion:

20693.png
20694.png
Hope it helps !!​

------------------------------
Ritansh Jatwani
Manager
Deloitte
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------

View answer in original post

6 REPLIES 6

ritansh.jatwani
Level 9
Hi @RishabhChauhan,

Whenever you are dealing with an excel automation, always try for code stage or inbuilt action items rather than going to the spying approach. Code stage is the fastest solution for performing the automation. Did you try code stage in this scenario?​

------------------------------
Ritansh Jatwani
Manager
Deloitte
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------

Thanks @ritansh.jatwani for the response.
I tried for the code stage but I was not able to succeed in that. Can you please share the code, if you have it?​

------------------------------
Rishabh Chauhan
------------------------------

Hi Rishabh

Do you mean you are trying to set the format of a cell from text to a number? or are you trying to get the cell value which is text in excel but you want it to go to a data item in blueprism as a number? 

If you want to extract it from excel into a blue prism data item then you just need to get the cell value using the Excel VBO and action Get cell value and let it output to a data item which has the datatype number.

If you want to format the cell value in excel from a text to a number then try using the Excel VBO with either Format cell or Format current cell actions and set the input format to "0"

Hope this helps 🙂

------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

Hi @RishabhChauhan,

You can use the below code for performing the conversion:

20693.png
20694.png
Hope it helps !!​

------------------------------
Ritansh Jatwani
Manager
Deloitte
Gurgaon
*If you find this post helpful mark it as best answer
------------------------------

Hi @Michael ONeil,

Thanks for your response. I have a huge set of data in an excel which needs conversion from text to number hence I can't use Get Cell Value as it needs to be done for every cell. While I was looking for a solution which can work on a full column. PFB the screenshot for what i was looking for:

20695.png
Also, I tried changing the format to '0' but it didn't work.​

------------------------------
Rishabh Chauhan
------------------------------

Thanks a ton @ritansh.jatwani.
The code worked perfectly fine!!​ 🙂

------------------------------
Rishabh Chauhan
------------------------------