I have come across many spell number functions and have reviewed many VBA code available on the net.
The core function that gets called repeatedly is the function that converts numbers from 001 to 999 as it is the core function for conversion under the English numeral system.
I have seen that this core function is sometime unnecessarily split over sub-functions for converting one, tens, and 20s to 90s.
I have developed the following simple VBA function that takes an input as number in a string format from “001” to “999” and returns the output as a string.
The function uses the dash “-“ for numbers e.g. Forty-Two.
The function is easily convertible to other languages.
With your assistance, I am looking to further improve or simplifying the function, if possible.
You may test the function like this:
Debug.Print Do999("123")
Debug.Print Do999("001")
Debug.Print Do999("099")
Thanks in advance for your contribution.
Bookmarks