TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   How to convert content into number ? (http://forums.techarena.in/software-development/1121823.htm)

Sean J 13-02-2009 09:59 AM

How to convert content into number ?
 
I have a new worry that I can not solve VMT.
I have this:
...
Case 6
Range ( "E8") = "159768.02": Range ( "E9") = "191.77": Range ( "E10") = "55,918.80" Range ( "E11") = "67.12 "
...

But what do I need for my values "159,768.02" ... are numbers in my table?
CDbl (...) I always use for my textbox, but here, as it is me who writes the values in advance, I do not know the correct syntax.

Aleksandra 13-02-2009 10:03 AM

Re: How to convert content into number ?
 
It seems to me that you can use CDbl () here, but there may be a problem with point and the comma.
Try: Range ( "E8") = CDbl ( "159768.02") or Range ( "E8") = CDbl (159,768.02)

Or maybe it directly, by not putting quotation marks: Range ( "E8") = 159768.02

Archibald 13-02-2009 10:07 AM

Re: How to convert content into number ?
 
Well you have a point and a comma in your number. E8 and E10 will never be numbers to Excel. Either you put a point or a comma. But not both.

So to add something to what was said by Aleksandra, if you really want to keep your syntax and comma Point you can do this:
Range ( "E8") = CDbl (Replace ( "159768.02 ",".",""))

Best regards

Sean J 13-02-2009 10:08 AM

Re: How to convert content into number ?
 
it works thank you much ... but with the comma.
Problem solved, thank you much.


All times are GMT +5.5. The time now is 12:13 AM.