+ Reply to Thread
Results 1 to 10 of 10

Convert number to words

  1. #1
    Registered User
    Join Date
    02-04-2018
    Location
    Mizoram, India
    MS-Off Ver
    2016
    Posts
    22

    Convert number to words

    I want to convert a number (say 123) to One Two Three , not One Hundred and Twenty Three.

    I want it like this: (example)
    10 = One Zero
    5 = Five
    87 = Eight Seven

    Could not find any code on internet.

    Please help.

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert number to words

    You can use this UDF like any other formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    NumbersAsWords.jpg

    Place in a STANDARD module
    Please Login or Register  to view this content.
    Can also call from VBA like this
    Please Login or Register  to view this content.
    NumbersAsWordsVBA.jpg
    Last edited by kev_; 02-25-2018 at 01:07 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Registered User
    Join Date
    02-04-2018
    Location
    Mizoram, India
    MS-Off Ver
    2016
    Posts
    22

    Re: Convert number to words

    This is exactly what i want it...

    Thank you so much

  4. #4
    Registered User
    Join Date
    02-04-2018
    Location
    Mizoram, India
    MS-Off Ver
    2016
    Posts
    22

    Re: Convert number to words

    Hi kev_,
    I have some problem on using your code. I am using office 2007 and the code for standardmodule

    This code/function doesn't showup like other formulas when i type it. I have to type the whole words =NumberAsWords.
    Can i just rename the word "NumbersAsWords" in the code as "NasW" so that i have to type less when using it.

    What i want is when i type =Num, it should display this formula "=NumbersAsWords()" so that i can just click it to use it. Is it possible?

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert number to words

    What i want is when i type =Num, it should display this formula "=NumbersAsWords()" so that i can just click it to use it. Is it possible?
    - that is exactly what it does for me with 2016 (2007 behaves differently )

    NumbersAsWords2.jpg

    Try renaming it Public Function NumbersAsWords(numbers As String)
    - I do not know if it will help
    - I cannot test on 2007

    Can i just rename the word "NumbersAsWords" in the code as "NasW" so that i have to type less when using it
    - YES (you can use any name that is not the same as Excel is using for something else)

  6. #6
    Registered User
    Join Date
    02-04-2018
    Location
    Mizoram, India
    MS-Off Ver
    2016
    Posts
    22

    Re: Convert number to words

    At first, i thought the add-ins (your code) does not even load up. I want the way it is shown in your excel 2016, maybe not possible in 2007. But, it should be possible...)

    What i did:
    1. Open vb window (alt+f11)
    2. Insert new module
    3. Copy paste your code (to be used in standard module)
    4. Save it as excel add-ins format inside office add-ins folder "C:\Users\*\AppData\Roaming\Microsoft\Add-Ins"
    5. close vb window and excel
    6. open excel and activate the add-ins

    I think i have done correctly. (I am not sure in what format to be saved as. Excel add-ins or Excel macro-enabled or any other format)

    I'll try to figure it out, and if i can't, i'll just rename it

    Thank you so much

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Convert number to words

    Did you try my suggestion?
    - rename Public Function NumbersAsWords(numbers As String)

  8. #8
    Registered User
    Join Date
    02-04-2018
    Location
    Mizoram, India
    MS-Off Ver
    2016
    Posts
    22

    Re: Convert number to words

    Oh, I haven't tried that.

    I'll be able to test it by Monday only. By then, i'll tell you the result.

    Thank you

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,914

    Re: Convert number to words

    Just tested it in 2007 and it behaves like any other function.
    When I start typing =nu the function already appears in the list.
    Just doubleclick it, select cell, close brackets, enter and finished.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  10. #10
    Registered User
    Join Date
    02-04-2018
    Location
    Mizoram, India
    MS-Off Ver
    2016
    Posts
    22

    Re: Convert number to words

    Thanks for testing it for me bakerman2

    Again, thanks to kev_

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Convert number to words
    By abdumon7 in forum Excel General
    Replies: 7
    Last Post: 11-23-2017, 06:22 AM
  2. How to convert number into words
    By Terressa in forum Excel General
    Replies: 3
    Last Post: 06-23-2015, 03:24 AM
  3. [SOLVED] Convert Number to Words
    By SMILE in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2013, 01:24 AM
  4. Convert number in to words
    By harshaputhraya in forum Excel General
    Replies: 2
    Last Post: 05-08-2006, 05:35 AM
  5. Convert number into words
    By Blackwar in forum Excel General
    Replies: 4
    Last Post: 12-02-2005, 08:10 AM
  6. [SOLVED] number convert into words
    By Tahir Imran in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2005, 01:06 PM
  7. number convert into words
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-15-2005, 12:06 PM

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