How to write VBA code to convert numbers into words
How to save your code as an Excel Add-In (.xlam
)
How to reuse your formula across workbooks
Use cases in finance, accounting, billing & more
Converting numbers to words is essential in professional documents like invoices, cheques, and formal reports. Excel doesnβt have a built-in function for this, but with a custom VBA macro, you can automate this task and use it like any built-in formula. Imagine saying goodbye to manual typing and human error!
Step 1: Press ALT + F11 to Open VBA Editor
Go to Developer > Visual Basic. If not visible, enable Developer tab.
Step 2: Paste the Number to Words Code
Use our full code snippet from the video.
Step 3: Save as Add-In (.xlam)
Save the file as Excel Add-In to reuse it later.
Step 3: Save as Add-In (.xlam)
Save the file as Excel Add-In to reuse it later.
Step 4: Enable Add-In
Load the Add-In from Excel Options > Add-Ins > Browse.
Step 5: Use the Formula
Simply use
=NumberToWords(A1)
like any Excel formula.
Copy the below code for Convert numbers to words in Excel in VBA
Function NumberToWords(ByVal MyNumber)
Dim Units As String
Dim Teens As String
Dim Tens As String
Dim Thousands As String
Dim Temp As String
Dim DecimalPlace As Integer
Dim Count As Integer
ReDim Place(9) As String
Place(2) = ” Thousand “
Place(3) = ” Million “
Place(4) = ” Billion “
Place(5) = ” Trillion “
‘ Convert MyNumber to string and trim white space.
MyNumber = Trim(CStr(MyNumber))
‘ Find Position of decimal place.
DecimalPlace = InStr(MyNumber, “.”)
‘ Convert Substring before decimal point.
If DecimalPlace > 0 Then
Temp = Left(MyNumber, DecimalPlace – 1)
Else
Temp = MyNumber
End If
Count = 1
Do While Temp <> “”
Hundreds = Right(Temp, 3)
If Len(Temp) > 3 Then
Temp = Left(Temp, Len(Temp) – 3)
Else
Temp = “”
End If
If Hundreds <> “” Then
TempStr = “”
If Val(Hundreds) <> 0 Then
Hundreds = Right(“000” & Hundreds, 3)
‘ Convert hundreds place.
If Mid(Hundreds, 1, 1) <> “0” Then
TempStr = GetDigit(Mid(Hundreds, 1, 1)) & ” Hundred “
End If
‘ Convert tens and ones place.
If Mid(Hundreds, 2, 1) <> “0” Then
TempStr = TempStr & GetTens(Mid(Hundreds, 2))
Else
TempStr = TempStr & GetDigit(Mid(Hundreds, 3))
End If
End If
NumberToWords = TempStr & Place(Count) & NumberToWords
End If
Count = Count + 1
Loop
‘ Convert Substring after decimal point.
If DecimalPlace > 0 Then
Temp = Mid(MyNumber, DecimalPlace + 1)
If Len(Temp) = 1 Then
Temp = Temp & “0”
End If
DecimalPlace = InStr(1, Temp, “/”)
If DecimalPlace = 0 Then
DecimalPlace = 3
End If
Temp = Mid(Temp, 1, DecimalPlace – 1)
NumberToWords = NumberToWords & ” and ” & Temp & “/100”
End If
End Function
Private Function GetDigit(Digit)
Select Case Val(Digit)
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
Private Function GetTens(TensText)
Dim Result As String
Result = “”
If Val(Left(TensText, 1)) = 1 Then
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
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 & ” ” & GetDigit(Right(TensText, 1))
End If
GetTens = Result
End Function
π₯ Video Link: [Video]Β
How to Convert numbers to words in Excel | VBA Add-In Tutorial by Techbikash28
π Playlist: Excel Mastery Series β Kalpavriksh Software
We donβt just teach Excelβwe teach real-world Excel. At Kalpavriksh Software, our mission is to make Indian youth job-ready with the most essential tech tools.
Explore other tutorials by Bikash Sarangi on:
Excel Functions (IF, IFS, TEXT, DATE)
VLOOKUP, HLOOKUP, XLOOKUP
Sorting, filtering & charting techniques
Excel tips for interview preparation
π Visit: www.techbikash28.com
π± Instagram & YouTube: @techbikash28
π Training powered by: Kalpavriksh Software | Startup India Recognized
Convert numbers to words in Excel might seem like a small trick, but it makes a huge difference in the professional world. Whether you’re preparing invoices, bills, cheques, or financial reports, automating this step saves time, ensures accuracy, and enhances presentation. Thanks to VBA and Excel Add-Ins, Convert numbers to words in Excel is easy.
At Techbikash28, we believe in making complex tech simple. With guidance from Bikash Sarangi and training modules from Kalpavriksh Software, you now have access to practical, industry-focused tools that help boost your career and elevate your business workflows.
Bikash Sarangi is a tech educator, automation expert, and the founder of TechBikash28, a platform designed to make real-world technology accessible. Recognized by Startup India, his mission is to simplify learning with tools like Google Apps Script, Power BI, Excel, and custom web applications.
From Bhubaneswar, Odisha, to learners across India and beyond, Bikash has created a strong following through practical tutorials, live training sessions, and custom business solutions.
Follow Us:
π§ kvsoftindia@gmail.com
π± +91 7978288532
π www.techbikash28.com
πΊ YouTube: Techbikash28
π· Instagram: @techbikash28