انتقل إلى المحتوى الرئيسي

كيفية تحويل الأرقام بسرعة إلى كلمات إنجليزية في إكسيل؟

إذا كان لديك عمود من القيم الرقمية في ورقة عمل ، فأنت الآن بحاجة إلى توجيههم إلى الكلمات الإنجليزية المكافئة أو كلمات العملة الإنجليزية كما هو موضح في لقطة الشاشة التالية. هنا سأتحدث عن كيفية تغيير الأرقام إلى كلمات إنجليزية بسرعة وسهولة.

تحويل الأرقام إلى الكلمات الإنجليزية مع وظيفة محددة من قبل المستخدم

تحويل الأرقام إلى كلمات العملة باستخدام الوظيفة المعرفة من قبل المستخدم

تحويل الأرقام إلى كلمات العملة مع ميزة مفيدة


تحويل الأرقام إلى الكلمات الإنجليزية مع وظيفة محددة من قبل المستخدم

لا توجد ميزات أو صيغ يمكن أن تساعدك في حل هذه المهمة مباشرة في Excel ، ولكن يمكنك إنشاء وظيفة محددة من قبل المستخدم لإنهائها. يرجى اتباع الخطوات التالية:

1. اضغط باستمرار ALT + F11 مفاتيح ، ويفتح نافذة ميكروسوفت فيسوال باسيك للتطبيقات.

2. انقر إدراج > وحدة، والصق الكود التالي في ملف نافذة الوحدة.

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. احفظ وأغلق هذا الرمز ثم ارجع إلى ورقة العمل ، في خلية فارغة ، أدخل هذه الصيغة = NumberstoWords (A2)( A2 هي الخلية التي تريد تحويل الرقم إلى كلمة إنجليزية) ، انظر الصورة:

4. ثم اضغط أدخل المفتاح ، وحدد الخلية C2 ثم اسحب مقبض التعبئة إلى النطاق الذي تريد أن تحتوي على هذه الصيغة. تم تحويل جميع القيم الرقمية للكلمات الإنجليزية المقابلة لها.

ملاحظات: هذا الرمز يعمل فقط مع الأعداد الصحيحة ولكنه لا ينطبق على الأعداد العشرية.


تحويل الأرقام إلى كلمات العملة باستخدام الوظيفة المعرفة من قبل المستخدم

إذا كنت ترغب في تحويل الأرقام إلى كلمات عملة إنجليزية ، فيجب عليك تطبيق رمز VBA أدناه.

1. اضغط باستمرار ALT + F11 مفاتيح ، ويفتح نافذة ميكروسوفت فيسوال باسيك للتطبيقات.

2. انقر إدراج > وحدة، والصق الكود التالي في ملف نافذة الوحدة.

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. احفظ هذا الرمز وأعد ورقة العمل ، في خلية فارغة ، أدخل هذه الصيغة = SpellNumberToEnglish (A2)( A2 هي الخلية التي تريد تحويل الرقم إلى كلمة عملة إنجليزية) ، ثم اسحب مقبض التعبئة لأسفل إلى الخلايا التي تريد تطبيق هذه الصيغة ، تم كتابة جميع الأرقام في كلمات العملة الإنجليزية ، انظر لقطة الشاشة:


تحويل الأرقام إلى كلمات العملة مع ميزة مفيدة

الكود أعلاه مزعج إلى حد ما بالنسبة للمبتدئين في برنامج Excel ، هنا ، سأقدم ميزة مفيدة ، كوتولس ل إكسيل's أرقام إلى كلمات، باستخدام هذه الأداة ، يمكنك تهجئة الأرقام بسرعة إلى كلمات إنجليزية أو كلمات عملات.

نصيحة:لتطبيق هذا أرقام إلى كلمات الميزة ، أولاً ، يجب عليك تنزيل ملف كوتولس ل إكسيل، ثم قم بتطبيق الميزة بسرعة وسهولة.

بعد تثبيت كوتولس ل إكسيل، يرجى القيام بذلك على النحو التالي:

1. حدد قائمة الأرقام التي تريد تحويلها ، ثم انقر فوق كوتولس > وصف المنتج > أرقام إلى كلمات، انظر لقطة الشاشة:

2. في الأرقام إلى كلمات العملات مربع الحوار ، تحقق عربي الخيار من اللغات مربع القائمة ، ثم انقر فوق موافق Ok زر ، سترى جميع الأرقام مكتوبة بكلمات العملة الإنجليزية:

نصائح: إذا كنت ترغب في الحصول على الكلمات الإنجليزية ، يرجى التحقق من لم يتم التحويل إلى العملة خانة الاختيار من مزيد من الخيارات القسم ، انظر لقطات الشاشة:

انقر لتنزيل Kutools for Excel والتجربة المجانية الآن!

أفضل أدوات إنتاجية المكتب

🤖 مساعد Kutools AI: إحداث ثورة في تحليل البيانات على أساس: التنفيذ الذكي   |  إنشاء التعليمات البرمجية  |  إنشاء صيغ مخصصة  |  تحليل البيانات وإنشاء الرسوم البيانية  |  استدعاء وظائف Kutools...
الميزات الشعبية: البحث عن التكرارات أو تمييزها أو تحديدها   |  حذف الصفوف الفارغة   |  دمج الأعمدة أو الخلايا دون فقدان البيانات   |   جولة بدون صيغة 
سوبر بحث: معايير متعددة VLookup    VLookup ذات القيمة المتعددة  |   VLookup عبر أوراق متعددة   |   بحث غامض ....
قائمة منسدلة متقدمة: إنشاء القائمة المنسدلة بسرعة   |  القائمة المنسدلة التابعة   |  قائمة منسدلة متعددة التحديد ....
مدير العمود: إضافة عدد محدد من الأعمدة  |  نقل الأعمدة  |  تبديل حالة رؤية الأعمدة المخفية  |  مقارنة النطاقات والأعمدة 
الميزات المميزة: التركيز على الشبكة   |  عرض تصميم   |   شريط الفورمولا الكبير    مدير المصنفات والأوراق   |  مكتبة الموارد (النص السيارات)   |  منتقي التاريخ   |  اجمع أوراق العمل   |  تشفير/فك تشفير الخلايا    إرسال رسائل البريد الإلكتروني عن طريق القائمة   |  سوبر تصفية   |   مرشح خاص (تصفية غامق / مائل / يتوسطه خط ...) ...
أفضل 15 مجموعة أدوات12 نص الأدوات (إضافة نص, إزالة الأحرف، ...)   |   +50 رسم الأنواع (مخطط جانت، ...)   |   40+ عملي الصيغ (احسب العمر على أساس تاريخ الميلاد، ...)   |   19 إدخال الأدوات (أدخل رمز الاستجابة السريعة, إدراج صورة من المسار، ...)   |   12 تحويل الأدوات (أرقام إلى كلمات, نتيجة تحويل عملة، ...)   |   7 دمج وتقسيم الأدوات (الجمع بين الصفوف المتقدمة, تقسيم الخلايا، ...)   |   ... و اكثر

عزز مهاراتك في Excel باستخدام Kutools for Excel، واختبر كفاءة لم يسبق لها مثيل. يقدم Kutools for Excel أكثر من 300 ميزة متقدمة لتعزيز الإنتاجية وتوفير الوقت.  انقر هنا للحصول على الميزة التي تحتاجها أكثر...

الوصف


يجلب Office Tab الواجهة المبوبة إلى Office ، ويجعل عملك أسهل بكثير

  • تمكين التحرير والقراءة المبوبة في Word و Excel و PowerPointوالناشر والوصول و Visio والمشروع.
  • فتح وإنشاء مستندات متعددة في علامات تبويب جديدة من نفس النافذة ، بدلاً من النوافذ الجديدة.
  • يزيد من إنتاجيتك بنسبة 50٪ ، ويقلل مئات النقرات بالماوس كل يوم!
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