Convert Numbers Into Words
Convert Numbers Into Words
Search
Excel doesn’t have a default function that displays numbers as English words in a worksheet, but you can add this capability by
pasting the following SpellNumber function code into a VBA (Visual Basic for Applications) module. This function lets you
convert dollar and cent amounts to words with a formula, so 22.50 would read as Twenty-Two Dollars and Fifty Cents. This can
be very useful if you're using Excel as a template to print checks.
If you want to convert numeric values to text format without displaying them as words, use the TEXT function instead.
Note: Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This
includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes
that you are familiar with the VBA programming language, and with the tools that are used to create and to debug procedures.
Microsoft support engineers can help explain the functionality of a particular procedure. However, they will not modify these
examples to provide added functionality, or construct procedures to meet your specific requirements.
1. Use the keyboard shortcut, Alt + F11 to open the Visual Basic Editor (VBE).
Note: You can also access the Visual Basic Editor by showing the Developer tab in your ribbon.
Note: Known as a User Defined Function (UDF), this code automates the task of converting numbers to text
throughout your worksheet.
Option Explicit
'Main Function
MyNumber = Trim(Str(MyNumber))
End If
Count = 1
If Temp <> "" Then Dollars = Temp & Place(Count) & Dollars
Else
MyNumber = ""
End If
Count = Count + 1
Loop
Case ""
Case "One"
End Select
Case ""
Case "One"
Case Else
End Select
End Function
End If
Else
End If
GetHundreds = Result
End Function
Function GetTens(TensText)
Dim Result As String
Case Else
End Select
Case Else
End Select
End If
GetTens = Result
End Function
' Converts a number from 1 to 9 into text.
Function GetDigit(Digit)
End Select
End Function
5. Press Alt + Q to return to Excel. The SpellNumber function is now ready to use.
Note: This function works only for the current workbook. To use this function in another workbook, you must repeat
the steps to copy and paste the code in that workbook.
Top of Page
1. Type the formula =SpellNumber(A1) into the cell where you want to display a written number, where A1 is the cell
containing the number you want to convert. You can also manually type the value like =SpellNumber(22.50).
Top of Page
You can save your file as an Excel Macro-Enabled Workbook (.xlsm) to keep your file in its current format.
2. Click the Save as type drop-down menu, and select Excel Macro-Enabled Workbook.
3. Click Save.
Top of Page
See Also
TEXT function
Need more help?
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Microsoft 365 subscription Microsoft 365 training Microsoft security Accessibility center
benefits
Surface Pro Account profile Microsoft in education Microsoft Cloud Azure Careers
Surface Laptop Download Center Devices for education Microsoft Security Developer Center About Microsoft
Surface Laptop Studio 2 Microsoft Store support Microsoft Teams for Dynamics 365 Documentation Company news
Education
Surface Laptop Go 3 Returns Microsoft 365 Microsoft Learn Privacy at Microsoft
Microsoft 365 Education
Microsoft Copilot Order tracking Microsoft Power Platform Microsoft Tech Investors
How to buy for your Community
AI in Windows Certified Refurbished school Microsoft Teams Diversity and inclusion
Azure Marketplace
Explore Microsoft products Microsoft Store Promise Educator training and Copilot for Microsoft 365 Accessibility
development AppSource
Windows 11 apps Flexible Payments Small Business Sustainability
Deals for students and Visual Studio
parents
Sitemap Contact Microsoft Privacy Terms of use Trademarks Safety & eco Recycling About our ads © Microsoft 2024