Skip to main content

How to quickly convert numbers to English words in Excel?

If you have a column of numeric values in a worksheet, and now you need to convent them to their equivalent English words or English currency words as following screenshot shown. Here I will talk about how to change the numbers to English words quickly and easily.

Convert numbers to English words with User Defined Function

Convert numbers to currency words with User Defined Function

Convert numbers to currency words with a useful feature


Convert numbers to English words with User Defined Function

There are no features or formulas can help you to solve this task directly in Excel, but you can create a User Defined Function to finish it. Please do with following steps:

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications Window.

2. Click Insert > Module, and paste the following code in the Module Window.

Function NumberstoWords(ByVal MyNumber)
'Update by Extendoffice
Dim xStr As String
Dim xFNum As Integer
Dim xStrPoint
Dim xStrNumber
Dim xPoint As String
Dim xNumber As String
Dim xP() As Variant
Dim xDP
Dim xCnt As Integer
Dim xResult, xT As String
Dim xLen As Integer
On Error Resume Next
xP = Array("", "Thousand ", "Million ", "Billion ", "Trillion ", " ", " ", " ", " ")
xNumber = Trim(Str(MyNumber))
xDP = InStr(xNumber, ".")
xPoint = ""
xStrNumber = ""
If xDP > 0 Then
xPoint = " point "
xStr = Mid(xNumber, xDP + 1)
xStrPoint = Left(xStr, Len(xNumber) - xDP)
For xFNum = 1 To Len(xStrPoint)
xStr = Mid(xStrPoint, xFNum, 1)
xPoint = xPoint & GetDigits(xStr) & " "
Next xFNum
xNumber = Trim(Left(xNumber, xDP - 1))
End If
xCnt = 0
xResult = ""
xT = ""
xLen = 0
xLen = Int(Len(Str(xNumber)) / 3)
If (Len(Str(xNumber)) Mod 3) = 0 Then xLen = xLen - 1
Do While xNumber <> ""
If xLen = xCnt Then
xT = GetHundredsDigits(Right(xNumber, 3), False)
Else
If xCnt = 0 Then
xT = GetHundredsDigits(Right(xNumber, 3), True)
Else
xT = GetHundredsDigits(Right(xNumber, 3), False)
End If
End If
If xT <> "" Then
xResult = xT & xP(xCnt) & xResult
End If
If Len(xNumber) > 3 Then
xNumber = Left(xNumber, Len(xNumber) - 3)
Else
xNumber = ""
End If
xCnt = xCnt + 1
Loop
xResult = xResult & xPoint
NumberstoWords = xResult
End Function
Function GetHundredsDigits(xHDgt, xB As Boolean)
Dim xRStr As String
Dim xStrNum As String
Dim xStr As String
Dim xI As Integer
Dim xBB As Boolean
xStrNum = xHDgt
xRStr = ""
On Error Resume Next
xBB = True
If Val(xStrNum) = 0 Then Exit Function
xStrNum = Right("000" & xStrNum, 3)
xStr = Mid(xStrNum, 1, 1)
If xStr <> "0" Then
xRStr = GetDigits(Mid(xStrNum, 1, 1)) & "Hundred "
Else
If xB Then
xRStr = "and "
xBB = False
Else
xRStr = " "
xBB = False
End If
End If
If Mid(xStrNum, 2, 2) <> "00" Then
xRStr = xRStr & GetTenDigits(Mid(xStrNum, 2, 2), xBB)
End If
GetHundredsDigits = xRStr
End Function
Function GetTenDigits(xTDgt, xB As Boolean)
Dim xStr As String
Dim xI As Integer
Dim xArr_1() As Variant
Dim xArr_2() As Variant
Dim xT As Boolean
xArr_1 = Array("Ten ", "Eleven ", "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ", "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen ")
xArr_2 = Array("", "", "Twenty ", "Thirty ", "Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety ")
xStr = ""
xT = True
On Error Resume Next
If Val(Left(xTDgt, 1)) = 1 Then
xI = Val(Right(xTDgt, 1))
If xB Then xStr = "and "
xStr = xStr & xArr_1(xI)
Else
xI = Val(Left(xTDgt, 1))
If Val(Left(xTDgt, 1)) > 1 Then
If xB Then xStr = "and "
xStr = xStr & xArr_2(Val(Left(xTDgt, 1)))
xT = False
End If
If xStr = "" Then
If xB Then
xStr = "and "
End If
End If
If Right(xTDgt, 1) <> "0" Then
xStr = xStr & GetDigits(Right(xTDgt, 1))
End If
End If
GetTenDigits = xStr
End Function
Function GetDigits(xDgt)
Dim xStr As String
Dim xArr_1() As Variant
xArr_1 = Array("Zero ", "One ", "Two ", "Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine ")
xStr = ""
On Error Resume Next
xStr = xArr_1(Val(xDgt))
GetDigits = xStr
End Function

3. Save and close this code and go back the worksheet, in a blank cell, enter this formula =NumberstoWords(A2)( A2 is the cell you want to convert the number to an English word), see screenshot:

4. Then press Enter key, and select cell C2 then drag the fill handle to the range that you want to contain this formula. All the numeric values have been converted their corresponding English words.

Note: This code only works for integer numbers but does not apply to decimal numbers.


Convert numbers to currency words with User Defined Function

If you want to convert the numbers into English currency words, you should apply the below VBA code.

1. Hold down the ALT + F11 keys, and it opens the Microsoft Visual Basic for Applications Window.

2. Click Insert > Module, and paste the following code in the Module Window.

Function SpellNumberToEnglish(ByVal pNumber)
'Update by Extendoffice
Dim Dollars, Cents
arr = Array("", "", " Thousand ", " Million ", " Billion ", " Trillion ")
pNumber = Trim(Str(pNumber))
xDecimal = InStr(pNumber, ".")
If xDecimal > 0 Then
    Cents = GetTens(Left(Mid(pNumber, xDecimal + 1) & "00", 2))
    pNumber = Trim(Left(pNumber, xDecimal - 1))
End If
xIndex = 1
Do While pNumber <> ""
    xHundred = ""
    xValue = Right(pNumber, 3)
    If Val(xValue) <> 0 Then
        xValue = Right("000" & xValue, 3)
        If Mid(xValue, 1, 1) <> "0" Then
            xHundred = GetDigit(Mid(xValue, 1, 1)) & " Hundred "
        End If
        If Mid(xValue, 2, 1) <> "0" Then
            xHundred = xHundred & GetTens(Mid(xValue, 2))
        Else
            xHundred = xHundred & GetDigit(Mid(xValue, 3))
        End If
    End If
    If xHundred <> "" Then
        Dollars = xHundred & arr(xIndex) & Dollars
    End If
    If Len(pNumber) > 3 Then
        pNumber = Left(pNumber, Len(pNumber) - 3)
    Else
        pNumber = ""
    End If
    xIndex = xIndex + 1
Loop
Select Case Dollars
    Case ""
        Dollars = "No Dollars"
    Case "One"
        Dollars = "One Dollar"
    Case Else
        Dollars = Dollars & " Dollars"
End Select
Select Case Cents
    Case ""
        Cents = " and No Cents"
    Case "One"
        Cents = " and One Cent"
    Case Else
        Cents = " and " & Cents & " Cents"
End Select
SpellNumberToEnglish = Dollars & Cents
End Function
Function GetTens(pTens)
Dim Result As String
Result = ""
If Val(Left(pTens, 1)) = 1 Then
    Select Case Val(pTens)
        Case 10: Result = "Ten"
        Case 11: Result = "Eleven"
        Case 12: Result = "Twelve"
        Case 13: Result = "Thirteen"
        Case 14: Result = "Fourteen"
        Case 15: Result = "Fifteen"
        Case 16: Result = "Sixteen"
        Case 17: Result = "Seventeen"
        Case 18: Result = "Eighteen"
        Case 19: Result = "Nineteen"
        Case Else
    End Select
Else
Select Case Val(Left(pTens, 1))
    Case 2: Result = "Twenty "
    Case 3: Result = "Thirty "
    Case 4: Result = "Forty "
    Case 5: Result = "Fifty "
    Case 6: Result = "Sixty "
    Case 7: Result = "Seventy "
    Case 8: Result = "Eighty "
    Case 9: Result = "Ninety "
    Case Else
End Select
Result = Result & GetDigit(Right(pTens, 1))
End If
GetTens = Result
End Function
Function GetDigit(pDigit)
Select Case Val(pDigit)
    Case 1: GetDigit = "One"
    Case 2: GetDigit = "Two"
    Case 3: GetDigit = "Three"
    Case 4: GetDigit = "Four"
    Case 5: GetDigit = "Five"
    Case 6: GetDigit = "Six"
    Case 7: GetDigit = "Seven"
    Case 8: GetDigit = "Eight"
    Case 9: GetDigit = "Nine"
    Case Else: GetDigit = ""
End Select
End Function

3. Save this code and go back the worksheet, in a blank cell, enter this formula =SpellNumberToEnglish(A2)( A2 is the cell you want to convert the number to an English currency word), and then drag the fill handle down to the cells that you want to apply this formula, all the numbers have been spelt out into English currency words, see screenshot:


Convert numbers to currency words with a useful feature

The above code is somewhat troublesome for Excel beginners, here, I will introduce a useful feature, Kutools for Excel's Numbers to Words, with this utility, you can quickly spell out the numbers into English words or currency words.

Tips:To apply this Numbers to Words feature, firstly, you should download the Kutools for Excel, and then apply the feature quickly and easily.

After installing Kutools for Excel, please do as this:

1. Select the list of numbers you want to convert, and then click Kutools > Content > Numbers to Words, see screenshot:

2. In the Numbers to Currency Words dialoge box, check English option from the Languages list box, and then click Ok button, you will see all the numbers have been spelt out into English currency words:

Tips: If you want to get the English words, please check the Not converted to Currency check box from the Options section, see screenshots:

Click to Download Kutools for Excel and free trial Now!

Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions…
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
Comments (66)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello dear.
It work good but after reopening the file. function is not working. what is the reason....? it can be solved or copy paste every time while open the same file.
This comment was minimized by the moderator on the site
Hello, Sheraz,
To keep the code work correctly, you should save the workbbok as Excel Macro-Enabled Workbook format. This file format will save the vba code.
Please try, hope it can help you!
This comment was minimized by the moderator on the site
Thank you for sharing such a wonderful program.

Kindly advise, I want to convert figures into words like "515,253.33" to show as Five Hundred Fifteen Thousand Two Hundred Fifty Three and Cents Thirty Three Only. Also it should not show "Dollars"
Warm regards,
Khozema
This comment was minimized by the moderator on the site
HI SIR/MADAM,

ITS WORKING GOOD BUT I NEED ONE THINK TO ADD "LAKS & CROSE" HOW TO ADD PLESE ATTACHED THIS CODE TO ME THANKS
This comment was minimized by the moderator on the site
Thank you so much... it works awesome
This comment was minimized by the moderator on the site
What needs to be changed if i want to make the decimal place into this "and ___/100"? For examples, instead of "ONE MILLION FOUR HUNDRED THIRTY THOUSAND TWO HUNDRED FORTY FIVE PESOS AND EIGHTY ONE CENTS", i want it to be like "ONE MILLION FOUR HUNDRED THIRTY THOUSAND TWO HUNDRED FORTY FIVE PESOS AND 81/100"
This comment was minimized by the moderator on the site
Hello, Maxine
To get the result you said, please apply the below code:
After pasting the code, please apply this formula:=SpellNumberToEnglish(A2)
Function SpellNumberToEnglish(ByVal pNumber)
'Update by Extendoffice
Dim Dollars, Cents
arr = Array("", "", " Thousand ", " Million ", " Billion ", " Trillion ")
pNumber = Trim(Str(pNumber))
xDecimal = InStr(pNumber, ".")
If xDecimal > 0 Then
    Cents = Left(Mid(pNumber, xDecimal + 1) & "00", 2) & "/100" 'GetTens(Left(Mid(pNumber, xDecimal + 1) & "00", 2))
    pNumber = Trim(Left(pNumber, xDecimal - 1))
End If
xIndex = 1
Do While pNumber <> ""
    xHundred = ""
    xValue = Right(pNumber, 3)
    If Val(xValue) <> 0 Then
        xValue = Right("000" & xValue, 3)
        If Mid(xValue, 1, 1) <> "0" Then
            xHundred = GetDigit(Mid(xValue, 1, 1)) & " Hundred "
        End If
        If Mid(xValue, 2, 1) <> "0" Then
            xHundred = xHundred & GetTens(Mid(xValue, 2))
        Else
            xHundred = xHundred & GetDigit(Mid(xValue, 3))
        End If
    End If
    If xHundred <> "" Then
        Dollars = xHundred & arr(xIndex) & Dollars
    End If
    If Len(pNumber) > 3 Then
        pNumber = Left(pNumber, Len(pNumber) - 3)
    Else
        pNumber = ""
    End If
    xIndex = xIndex + 1
Loop
Select Case Dollars
    Case ""
        Dollars = "No Dollars"
    Case "One"
        Dollars = "One Dollar"
    Case Else
        Dollars = Dollars & " Dollars"
End Select
Select Case Cents
    Case ""
        Cents = "" ' " and No Cents"
    Case "One"
        Cents = "" 'and One Cent"
    Case Else
        Cents = " and " & Cents ' & " Cents"
End Select
SpellNumberToEnglish = Dollars & Cents
Debug.Print SpellNumberToEnglish
End Function
Function GetTens(pTens)
Dim Result As String
Result = ""
If Val(Left(pTens, 1)) = 1 Then
    Select Case Val(pTens)
        Case 10: Result = "Ten"
        Case 11: Result = "Eleven"
        Case 12: Result = "Twelve"
        Case 13: Result = "Thirteen"
        Case 14: Result = "Fourteen"
        Case 15: Result = "Fifteen"
        Case 16: Result = "Sixteen"
        Case 17: Result = "Seventeen"
        Case 18: Result = "Eighteen"
        Case 19: Result = "Nineteen"
        Case Else
    End Select
Else
Select Case Val(Left(pTens, 1))
    Case 2: Result = "Twenty "
    Case 3: Result = "Thirty "
    Case 4: Result = "Forty "
    Case 5: Result = "Fifty "
    Case 6: Result = "Sixty "
    Case 7: Result = "Seventy "
    Case 8: Result = "Eighty "
    Case 9: Result = "Ninety "
    Case Else
End Select
Result = Result & GetDigit(Right(pTens, 1))
End If
GetTens = Result
End Function
Function GetDigit(pDigit)
Select Case Val(pDigit)
    Case 1: GetDigit = "One"
    Case 2: GetDigit = "Two"
    Case 3: GetDigit = "Three"
    Case 4: GetDigit = "Four"
    Case 5: GetDigit = "Five"
    Case 6: GetDigit = "Six"
    Case 7: GetDigit = "Seven"
    Case 8: GetDigit = "Eight"
    Case 9: GetDigit = "Nine"
    Case Else: GetDigit = ""
End Select
End Function


Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Hi,

Great code thanks. One question. Is it possible to save someway this module to in any new document be avilable? Or i need do this process any time if im want this in another document?

Thanks
This comment was minimized by the moderator on the site
Hello Nemeth,

Glad to help. I have a solution to your question. You can save an empty document with VBA code as Excel Add-in (*.xlam). Then you can use the add-in by clicking the Developer tab > Excel-Add-ins in Excel. Please have a try. And if you have any questions, please don't hesitate to contact us. Have a nice day.

Sincerely,
Mandy
This comment was minimized by the moderator on the site
hi, how can i do the opposite, I want to convert from ( one hundred fifty five) to (155). could you help me please?
This comment was minimized by the moderator on the site
Hi, Ghada,For converting the words to numbers, you should apply the below code:After pasting the code, please use this formula: =wordstodigits(A2)Please try, hope it can help you!<div data-tag="code">Option Explicit
Const wordDollar1 = "DOLLAR"
Const wordDollar2 = "DOLLARS"
Const oneTrillion = "TRILLION"
Const oneBillion = "BILLION"
Const oneMillion = "MILLION"
Const oneThousand = "THOUSAND"
Const oneHundred = "HUNDRED"
Dim theWords As String

Function WordsToDigits(theWordCell As Range) As Currency
Dim curPart As String
Dim theDigits As Currency
Dim Pt1 As Integer
Dim Pt2 As Integer
Dim Trillions As Currency
Dim Billions As Currency
Dim Millions As Currency
Dim Thousands As Currency
Dim Hundreds As Currency
Dim Tens As Currency
Dim Units As Currency
Dim whatGroup As String
Dim theFraction As Double
Dim hasFraction As Boolean
If IsEmpty(theWordCell) Then
Exit Function
End If
theWords = UCase(Trim(Application.WorksheetFunction.Clean(theWordCell)))
theWords = Replace(theWords, "-", " ")
theWords = Replace(theWords, "DOLLARS", " ")
theWords = Replace(theWords, "DOLLAR", " ")
Do While InStr(theWords, " ") > 0
theWords = Replace(theWords, " ", " ")
Loop
If InStr(theWords, "/") > 0 Or InStr(theWords, " AND ") > 0 Then
hasFraction = True
theFraction = CalculateTheFraction()
End If
Trillions = EvaluateGroupValue(oneTrillion)
Billions = EvaluateGroupValue(oneBillion)
Millions = EvaluateGroupValue(oneMillion)
Thousands = EvaluateGroupValue(oneThousand)
If InStr(theWords, oneHundred) > 0 Then
curPart = Left(theWords, InStr(theWords, oneHundred) + Len(oneHundred))
theWords = Right(theWords, Len(theWords) - Len(curPart))
Hundreds = GetHundreds(curPart)
End If
theWords = Trim(theWords)
Tens = GetTens(theWords)
theDigits = CCur((Trillions * 1000000000000#)) + CCur((Billions * 1000000000#)) + _
CCur((Millions * 1000000#)) + CCur((Thousands * 1000)) + CCur((Hundreds * 100)) + Tens
If hasFraction Then
theDigits = theDigits + theFraction
End If
WordsToDigits = theDigits
End Function

Private Function EvaluateGroupValue(strGroup As String) As Currency
Dim curPart As String
If InStr(theWords, strGroup) > 0 Then
curPart = Left(theWords, InStr(theWords, strGroup) + Len(strGroup))
theWords = Right(theWords, Len(theWords) - Len(curPart))
EvaluateGroupValue = GetLargeValues(curPart, strGroup)
End If
End Function

Private Function GetLargeValues(strAmount As String, strGroup As String) As Currency
Dim tempText As String
Dim theTens As String
Dim theUnits As String
tempText = Trim(Left(strAmount, InStr(strAmount, strGroup) - 1))
tempText = Replace(tempText, strGroup, "")
If InStr(tempText, " " & oneHundred) > 0 Then
tempText = Replace(tempText, " " & oneHundred, "")
If InStr(tempText, " ") > 0 Then
GetLargeValues = GetUnits(Left(tempText, InStr(tempText, " ") - 1)) * 100
tempText = Right(tempText, Len(tempText) - InStr(tempText, " "))
If InStr(tempText, " ") > 0 Then
theTens = GetUnits(Left(tempText, InStr(tempText, " ") - 1))
theUnits = GetUnits(Trim(Right(tempText, Len(tempText) - InStr(tempText, " "))))
GetLargeValues = GetLargeValues + theTens + theUnits
Else
GetLargeValues = GetLargeValues + GetUnits(tempText)
End If
Else
GetLargeValues = GetUnits(tempText) * 100
End If
Exit Function
End If
If InStr(tempText, " ") > 0 Then
GetLargeValues = GetUnits(Left(tempText, InStr(tempText, " ") - 1))
GetLargeValues = GetLargeValues + GetUnits(Right(tempText, Len(tempText) - InStr(tempText, " ")))
Else
GetLargeValues = GetUnits(tempText)
End If
End Function

Private Function GetHundreds(strAmount As String) As Integer
Dim tempText As String
tempText = Trim(Left(strAmount, InStr(strAmount, oneHundred) - 1))
If InStr(tempText, " ") > 0 Then
GetHundreds = GetUnits(Left(tempText, InStr(tempText, " ") - 1))
GetHundreds = GetHundreds + GetUnits(Right(tempText, Len(tempText) - InStr(tempText, " ")))
Else
GetHundreds = GetUnits(tempText)
End If
End Function

Private Function GetTens(strAmount As String) As Integer
Dim tempText As String
tempText = Trim(strAmount)
If InStr(tempText, " ") > 0 Then
GetTens = GetUnits(Left(tempText, InStr(tempText, " ") - 1))
GetTens = GetTens + GetUnits(Right(tempText, Len(tempText) - InStr(tempText, " ")))
Else
GetTens = GetUnits(tempText)
End If
End Function

Private Function GetUnits(strAmount As String) As Integer
Dim tempText As String
tempText = Trim(strAmount)
Select Case tempText
Case Is = "ONE"
GetUnits = 1
Case Is = "TWO"
GetUnits = 2
Case Is = "THREE"
GetUnits = 3
Case Is = "FOUR"
GetUnits = 4
Case Is = "FIVE"
GetUnits = 5
Case Is = "SIX"
GetUnits = 6
Case Is = "SEVEN"
GetUnits = 7
Case Is = "EIGHT"
GetUnits = 8
Case Is = "NINE"
GetUnits = 9
Case Is = "TEN"
GetUnits = 10
Case Is = "ELEVEN"
GetUnits = 11
Case Is = "TWELVE"
GetUnits = 12
Case Is = "THIRTEEN"
GetUnits = 13
Case Is = "FOURTEEN"
GetUnits = 14
Case Is = "FIFTEEN"
GetUnits = 15
Case Is = "SIXTEEN"
GetUnits = 16
Case Is = "SEVENTEEN"
GetUnits = 17
Case Is = "EIGHTEEN"
GetUnits = 18
Case Is = "NINETEEN"
GetUnits = 19
Case Is = "TWENTY"
GetUnits = 20
Case Is = "THIRTY"
GetUnits = 30
Case Is = "FORTY", "FOURTY"
GetUnits = 40
Case Is = "FIFTY"
GetUnits = 50
Case Is = "SIXTY"
GetUnits = 60
Case Is = "SEVENTY"
GetUnits = 70
Case Is = "EIGHTY"
GetUnits = 80
Case Is = "NINETY"
GetUnits = 90
Case Else
GetUnits = 0
End Select
End Function

Private Function CalculateTheFraction() As Double
Dim fractionPart As String
Dim tempValue As Double
Dim toPower As Integer
Dim theDivisor As Double
If InStr(theWords, " AND ") > 0 Then
fractionPart = Right(theWords, Len(theWords) - InStr(theWords, " AND ") - 4)
theWords = Left(theWords, InStr(theWords, " AND ") - 1)
End If
If InStr(fractionPart, "/") > 0 Then
tempValue = Val(fractionPart)
theDivisor = Right(fractionPart, Len(fractionPart) - InStr(fractionPart, "/"))
CalculateTheFraction = tempValue / theDivisor
Exit Function
End If
tempValue = Val(fractionPart)
toPower = Len(CStr(tempValue))
theDivisor = 10 ^ toPower
CalculateTheFraction = tempValue / theDivisor
End Function
This comment was minimized by the moderator on the site
FINE. But sorry to say that this formula is NOT working permanently ... I closed the workbook for Lunch break. After Lunch I opened the file but the formula was not working. showing error like #NAME?. Kindly intimate solutions please.
This comment was minimized by the moderator on the site
Hello, Vignesh,To keep the code work correctly, you should save the workbbok as Excel Macro-Enabled Workbook format.Please try, hope it can help you!
This comment was minimized by the moderator on the site
But sorry to say that this formula is NOT working permanently ... I closed the workbook for Lunch break. After Lunch I opened the file but the formula was not working. showing error like #NAME?. Kindly intimate solutions please.
This comment was minimized by the moderator on the site
how do I convert 1101 to One One Zero One? I don't need dollars just want actual digits.
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations