+ Reply to Thread
Results 1 to 10 of 10

Text to Number

  1. #1
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    Office Home & Business 2016
    Posts
    162

    Text to Number

    Hi,

    I'm using an InputBox to obtain a number, however it records it as text (e.g. "5.5") instead of a number (5.5).

    How do I convert the text (inside the macro) to a number?

    Thanks

    Paul

  2. #2
    Valued Forum Contributor dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    940

    Re: Text to Number

    Possibly...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    Office Home & Business 2016
    Posts
    162

    Re: Text to Number

    Seems to do the trick. Thanks.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    14,654

    Re: Text to Number

    Use InputBox Function instead
    e.g
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    Office Home & Business 2016
    Posts
    162

    Re: Text to Number

    Works also. Thanks.

    Is there a way to get a Title on the InputBox, rather than just ¤nput"?

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    10,459

    Re: Text to Number

    Please Login or Register  to view this content.
    Ben Van Johnson

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    14,654

    Re: Text to Number

    You will find all the protocols like Default value.

    https://docs.microsoft.com/en-us/off...ation.inputbox

  8. #8
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    Office Home & Business 2016
    Posts
    162

    Re: Text to Number

    Thanks. Also works just fine

  9. #9
    Forum Contributor
    Join Date
    09-29-2011
    Location
    ɹǝpun uʍop
    MS-Off Ver
    Office Home & Business 2016
    Posts
    162

    Re: Text to Number

    Quote Originally Posted by jindon View Post
    You will find all the protocols like Default value.

    https://docs.microsoft.com/en-us/off...ation.inputbox
    Very handy. Thanks

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013
    Posts
    14,654

    Re: Text to Number

    You are welcome and thanks for the rep.

    When you want to limit the data type of return value, InputBox function is a better option.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1