Results 1 to 4 of 4

Thread: How to convert content into number ?

  1. #1
    Join Date
    Feb 2008
    Posts
    624

    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.

  2. #2
    Join Date
    May 2008
    Posts
    991

    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

  3. #3
    Join Date
    May 2008
    Posts
    1,196

    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

  4. #4
    Join Date
    Feb 2008
    Posts
    624

    Re: How to convert content into number ?

    it works thank you much ... but with the comma.
    Problem solved, thank you much.

Similar Threads

  1. How to convert number to text in excel
    By Jevin in forum Software Development
    Replies: 9
    Last Post: 17-05-2012, 06:42 PM
  2. Convert number to spell currency
    By Harinadhar in forum Windows Software
    Replies: 3
    Last Post: 02-04-2011, 05:01 PM
  3. Replies: 3
    Last Post: 27-11-2010, 12:59 AM
  4. How to convert vb .text to number format
    By Brunoz in forum Software Development
    Replies: 6
    Last Post: 04-07-2009, 09:18 PM
  5. convert string to number in asp.net
    By Texas in forum Software Development
    Replies: 3
    Last Post: 26-06-2009, 09:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,717,382,556.12119 seconds with 16 queries