SlideShare a Scribd company logo
1 of 8
1.   Start Microsoft Excel.

      2.   Press ALT+F11 to start the Visual Basic Editor.
      3.   On the Insert menu, click Module.

      4.   Type the following code into the module sheet.

      5.   Finally you will get the conversion with spell rupees




'****************

  ' Main Function *

  '****************



  Function SpellRupee(ByVal MyNumber)

    Dim Dollars, Cents, Temp, Temp1, Dollars1, Temp2

    Dim DecimalPlace, Count



    ReDim Place(9) As String

    Place(2) = " THOUSAND "

    Place(3) = " Million "

    Place(4) = " Billion "

    Place(5) = " Trillion "



    ' String representation of amount.

    MyNumber = Trim(Str(MyNumber))



    ' Position of decimal place 0 if none.

    DecimalPlace = InStr(MyNumber, ".")
' Convert cents and set MyNumber to dollar amount.

     If DecimalPlace > 0 Then

         Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _

           "00", 2))

         MyNumber = Trim(Left(MyNumber, DecimalPlace - 1))

     End If



     Count = 1

Temp2 = ""

If Len(MyNumber) > 7 Then

     Temp2 = GetHundreds(Left(MyNumber, Len(MyNumber) - 7)) & " CORES "

MyNumber = Right(MyNumber, 7)



End If



     Temp1 = ""

     If Len(MyNumber) > 5 Then

     Temp1 = GetHundreds(Left(MyNumber, Len(MyNumber) - 5)) & " LAKHS "

MyNumber = Right(MyNumber, 5)



     End If



     Do While MyNumber <> ""

         Temp = GetHundreds(Right(MyNumber, 3))

         If Temp <> "" Then Dollars1 = Temp & Place(Count) & Dollars1
If Len(MyNumber) > 3 Then

    MyNumber = Left(MyNumber, Len(MyNumber) - 3)

  Else

    MyNumber = ""

  End If

  Count = Count + 1

Loop

Dollars = Temp2 & Temp1 & Dollars1

Select Case Dollars

  Case ""

    Dollars = "NIL RUPEES"

  Case "One"

    Dollars = "ONE RUPEE "

  Case Else

    Dollars = " RUPEES " & Dollars & " ONLY "

End Select



Select Case Cents

  Case ""

    Cents = " "

  Case "One"

    Cents = " "

  Case Else

    Cents = " AND " & Cents & " PAISA"

End Select
SpellRupee = Dollars & Cents

End Function




'*******************************************

' Converts a number from 100-999 into text *

'*******************************************



Private Function GetHundreds(ByVal MyNumber)

  Dim Result As String



  If Val(MyNumber) = 0 Then Exit Function

  MyNumber = Right("000" & MyNumber, 3)



  ' Convert the hundreds place.

  If Mid(MyNumber, 1, 1) <> "0" Then

    Result = GetNumber(Mid(MyNumber, 1, 1)) & " HUNDRED "

  End If



  ' Convert the tens and ones place.

  If Mid(MyNumber, 2, 1) <> "0" Then

    Result = Result & GetTens(Mid(MyNumber, 2))

  Else
Result = Result & GetNumber(Mid(MyNumber, 3))

  End If



  GetHundreds = Result

End Function




'*********************************************

' Converts a number from 10 to 99 into text. *

'*********************************************



Private Function GetTens(TensText)

  Dim Result As String



  Result = ""      ' Null out the temporary function value.

  If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19...

    Select Case Val(TensText)

      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                     ' If value between 20-99...

    Select Case Val(Left(TensText, 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 & GetNumber _

         (Right(TensText, 1)) ' Retrieve ones place.

  End If

  GetTens = Result

End Function
'*******************************************

' Converts a number from 1 to 9 into text. *

'*******************************************



Private Function GetNumber(Digit)

  Select Case Val(Digit)

    Case 1: GetNumber = "ONE"

    Case 2: GetNumber = "TWO"

    Case 3: GetNumber = "THREE"

    Case 4: GetNumber = "FOUR"

    Case 5: GetNumber = "FIVE"

    Case 6: GetNumber = "SIX"

    Case 7: GetNumber = "SEVEN"

    Case 8: GetNumber = "EIGHT"

    Case 9: GetNumber = "NINE"

    Case Else: GetNumber = ""

  End Select

End Function
52 excel rupees converter formulae

More Related Content

Similar to 52 excel rupees converter formulae

unction NumberToWords.docx
unction NumberToWords.docxunction NumberToWords.docx
unction NumberToWords.docxpardeepwalia6
 
Fungsi Terbilang Valid 100%
Fungsi Terbilang Valid 100%Fungsi Terbilang Valid 100%
Fungsi Terbilang Valid 100%dnugroho78
 
ComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptxComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptxJohnPaulNavarro7
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxamrit47
 
Swift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdfSwift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdfJkPoppy
 
C# using Visual studio - Windows Form. If possible step-by-step inst.pdf
C# using Visual studio - Windows Form. If possible step-by-step inst.pdfC# using Visual studio - Windows Form. If possible step-by-step inst.pdf
C# using Visual studio - Windows Form. If possible step-by-step inst.pdffazalenterprises
 
Introduction to Kotlin.pptx
Introduction to Kotlin.pptxIntroduction to Kotlin.pptx
Introduction to Kotlin.pptxAzharFauzan9
 
01 Introduction to Kotlin - Programming in Kotlin.pptx
01 Introduction to Kotlin - Programming in Kotlin.pptx01 Introduction to Kotlin - Programming in Kotlin.pptx
01 Introduction to Kotlin - Programming in Kotlin.pptxIvanZawPhyo
 
Basic calculator tutorial
Basic calculator tutorialBasic calculator tutorial
Basic calculator tutorialGilkye
 
Programada chapter 4
Programada chapter 4Programada chapter 4
Programada chapter 4abdallaisse
 
Sine Wave Generator with controllable frequency displayed on a seven segment ...
Sine Wave Generator with controllable frequency displayed on a seven segment ...Sine Wave Generator with controllable frequency displayed on a seven segment ...
Sine Wave Generator with controllable frequency displayed on a seven segment ...Karthik Rathinavel
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersSheila Sinclair
 
Classical programming interview questions
Classical programming interview questionsClassical programming interview questions
Classical programming interview questionsGradeup
 
C++ Course - Lesson 2
C++ Course - Lesson 2C++ Course - Lesson 2
C++ Course - Lesson 2Mohamed Ahmed
 
Python 04-ifelse-return-input-strings.pptx
Python 04-ifelse-return-input-strings.pptxPython 04-ifelse-return-input-strings.pptx
Python 04-ifelse-return-input-strings.pptxTseChris
 
208180 building-number-place-value
208180 building-number-place-value208180 building-number-place-value
208180 building-number-place-valueFathimaRifa
 

Similar to 52 excel rupees converter formulae (20)

unction NumberToWords.docx
unction NumberToWords.docxunction NumberToWords.docx
unction NumberToWords.docx
 
Fungsi Terbilang Valid 100%
Fungsi Terbilang Valid 100%Fungsi Terbilang Valid 100%
Fungsi Terbilang Valid 100%
 
Terbilang
TerbilangTerbilang
Terbilang
 
ComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptxComEd101 - Chapter 2 Lesson 2.pptx
ComEd101 - Chapter 2 Lesson 2.pptx
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
 
Swift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdfSwift 5.1 Language Guide Notes.pdf
Swift 5.1 Language Guide Notes.pdf
 
TEST DATA
TEST DATATEST DATA
TEST DATA
 
C# using Visual studio - Windows Form. If possible step-by-step inst.pdf
C# using Visual studio - Windows Form. If possible step-by-step inst.pdfC# using Visual studio - Windows Form. If possible step-by-step inst.pdf
C# using Visual studio - Windows Form. If possible step-by-step inst.pdf
 
Introduction to Kotlin.pptx
Introduction to Kotlin.pptxIntroduction to Kotlin.pptx
Introduction to Kotlin.pptx
 
01 Introduction to Kotlin - Programming in Kotlin.pptx
01 Introduction to Kotlin - Programming in Kotlin.pptx01 Introduction to Kotlin - Programming in Kotlin.pptx
01 Introduction to Kotlin - Programming in Kotlin.pptx
 
Basic calculator tutorial
Basic calculator tutorialBasic calculator tutorial
Basic calculator tutorial
 
Decompiladores
DecompiladoresDecompiladores
Decompiladores
 
Programada chapter 4
Programada chapter 4Programada chapter 4
Programada chapter 4
 
Sine Wave Generator with controllable frequency displayed on a seven segment ...
Sine Wave Generator with controllable frequency displayed on a seven segment ...Sine Wave Generator with controllable frequency displayed on a seven segment ...
Sine Wave Generator with controllable frequency displayed on a seven segment ...
 
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And EngineersAnswers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
Answers To Selected Exercises For Fortran 90 95 For Scientists And Engineers
 
Classical programming interview questions
Classical programming interview questionsClassical programming interview questions
Classical programming interview questions
 
C++ Course - Lesson 2
C++ Course - Lesson 2C++ Course - Lesson 2
C++ Course - Lesson 2
 
Python 04-ifelse-return-input-strings.pptx
Python 04-ifelse-return-input-strings.pptxPython 04-ifelse-return-input-strings.pptx
Python 04-ifelse-return-input-strings.pptx
 
208180 building-number-place-value
208180 building-number-place-value208180 building-number-place-value
208180 building-number-place-value
 
Vb file
Vb fileVb file
Vb file
 

Recently uploaded

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Recently uploaded (20)

Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

52 excel rupees converter formulae

  • 1. 1. Start Microsoft Excel. 2. Press ALT+F11 to start the Visual Basic Editor. 3. On the Insert menu, click Module. 4. Type the following code into the module sheet. 5. Finally you will get the conversion with spell rupees '**************** ' Main Function * '**************** Function SpellRupee(ByVal MyNumber) Dim Dollars, Cents, Temp, Temp1, Dollars1, Temp2 Dim DecimalPlace, Count ReDim Place(9) As String Place(2) = " THOUSAND " Place(3) = " Million " Place(4) = " Billion " Place(5) = " Trillion " ' String representation of amount. MyNumber = Trim(Str(MyNumber)) ' Position of decimal place 0 if none. DecimalPlace = InStr(MyNumber, ".")
  • 2. ' Convert cents and set MyNumber to dollar amount. If DecimalPlace > 0 Then Cents = GetTens(Left(Mid(MyNumber, DecimalPlace + 1) & _ "00", 2)) MyNumber = Trim(Left(MyNumber, DecimalPlace - 1)) End If Count = 1 Temp2 = "" If Len(MyNumber) > 7 Then Temp2 = GetHundreds(Left(MyNumber, Len(MyNumber) - 7)) & " CORES " MyNumber = Right(MyNumber, 7) End If Temp1 = "" If Len(MyNumber) > 5 Then Temp1 = GetHundreds(Left(MyNumber, Len(MyNumber) - 5)) & " LAKHS " MyNumber = Right(MyNumber, 5) End If Do While MyNumber <> "" Temp = GetHundreds(Right(MyNumber, 3)) If Temp <> "" Then Dollars1 = Temp & Place(Count) & Dollars1
  • 3. If Len(MyNumber) > 3 Then MyNumber = Left(MyNumber, Len(MyNumber) - 3) Else MyNumber = "" End If Count = Count + 1 Loop Dollars = Temp2 & Temp1 & Dollars1 Select Case Dollars Case "" Dollars = "NIL RUPEES" Case "One" Dollars = "ONE RUPEE " Case Else Dollars = " RUPEES " & Dollars & " ONLY " End Select Select Case Cents Case "" Cents = " " Case "One" Cents = " " Case Else Cents = " AND " & Cents & " PAISA" End Select
  • 4. SpellRupee = Dollars & Cents End Function '******************************************* ' Converts a number from 100-999 into text * '******************************************* Private Function GetHundreds(ByVal MyNumber) Dim Result As String If Val(MyNumber) = 0 Then Exit Function MyNumber = Right("000" & MyNumber, 3) ' Convert the hundreds place. If Mid(MyNumber, 1, 1) <> "0" Then Result = GetNumber(Mid(MyNumber, 1, 1)) & " HUNDRED " End If ' Convert the tens and ones place. If Mid(MyNumber, 2, 1) <> "0" Then Result = Result & GetTens(Mid(MyNumber, 2)) Else
  • 5. Result = Result & GetNumber(Mid(MyNumber, 3)) End If GetHundreds = Result End Function '********************************************* ' Converts a number from 10 to 99 into text. * '********************************************* Private Function GetTens(TensText) Dim Result As String Result = "" ' Null out the temporary function value. If Val(Left(TensText, 1)) = 1 Then ' If value between 10-19... Select Case Val(TensText) 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"
  • 6. Case 17: Result = "SEVENTEEN" Case 18: Result = "EIGHTEEN" Case 19: Result = "NINETEEN" Case Else End Select Else ' If value between 20-99... Select Case Val(Left(TensText, 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 & GetNumber _ (Right(TensText, 1)) ' Retrieve ones place. End If GetTens = Result End Function
  • 7. '******************************************* ' Converts a number from 1 to 9 into text. * '******************************************* Private Function GetNumber(Digit) Select Case Val(Digit) Case 1: GetNumber = "ONE" Case 2: GetNumber = "TWO" Case 3: GetNumber = "THREE" Case 4: GetNumber = "FOUR" Case 5: GetNumber = "FIVE" Case 6: GetNumber = "SIX" Case 7: GetNumber = "SEVEN" Case 8: GetNumber = "EIGHT" Case 9: GetNumber = "NINE" Case Else: GetNumber = "" End Select End Function