Attribute VB_Name = "AmountToWords" ' Converts a number to English words. Usage: =SpellNumber(1234) Function SpellNumber(ByVal n As Double) As String Dim groups As Variant, parts As String, idx As Long, num As Long, chunk As Long groups = Array("", " Thousand", " Million", " Billion") num = Int(n) If num = 0 Then SpellNumber = "Zero": Exit Function idx = 0 Do While num > 0 chunk = num Mod 1000 If chunk > 0 Then parts = ThreeDigits(chunk) & groups(idx) & " " & parts num = num \ 1000 idx = idx + 1 Loop SpellNumber = Trim(parts) End Function Private Function ThreeDigits(ByVal n As Long) As String Dim ones As Variant, teens As Variant, tens As Variant, s As String ones = Array("", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine") teens = Array("Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen") tens = Array("", "", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety") If n >= 100 Then s = ones(n \ 100) & " Hundred " n = n Mod 100 End If If n >= 20 Then s = s & tens(n \ 10) & " " n = n Mod 10 ElseIf n >= 10 Then s = s & teens(n - 10) & " " n = 0 End If If n > 0 Then s = s & ones(n) & " " ThreeDigits = Trim(s) End Function