Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Converting Numbers to Text.

Converting Numbers to Text

by Allen Wyatt
(last updated February 7, 2013)


There are times when you need to spell numbers out. For instance, you may want to spell out "1234" as "one thousand two hundred thirty-four." Word has no built-in function that will do the conversion for you, so you are left to create a macro that will handle the conversion.

The following macro, BigCardText, will convert any number between 0 and 999,999,999. To use it, simply place the insertion point either within the number you want to convert or just to the right of the number (if it is a single digit).

Sub BigCardText()
    Dim sDigits As String
    Dim sBigStuff As String

    sBigStuff = ""

    ' Select the full number in which the insertion point is located
    Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdMove
    Selection.MoveRight Unit:=wdWord, Count:=1, Extend:=wdExtend

    ' Store the digits in a variable
    sDigits = Trim(Selection.Text)

    If Val(sDigits) > 999999 Then
        If Val(sDigits) <= 999999999 Then
            sBigStuff = Trim(Int(Str(Val(sDigits) / 1000000)))
            ' Create a field containing the big digits and
            ' the cardtext format flag
            Selection.Fields.Add Range:=Selection.Range, _
              Type:=wdFieldEmpty, Text:="= " + sBigStuff + " \* CardText", _

            ' Select the field and copy it
            Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
            sBigStuff = Selection.Text & " million "
            sDigits = Right(sDigits, 6)
        End If
    End If
    If Val(sDigits) <= 999999 Then
        ' Create a field containing the digits and the cardtext format flag
        Selection.Fields.Add Range:=Selection.Range, _
          Type:=wdFieldEmpty, Text:="= " + sDigits + " \* CardText", _

        ' Select the field and copy it
        Selection.MoveLeft Unit:=wdWord, Count:=1, Extend:=wdExtend
        sDigits = sBigStuff & Selection.Text

        ' Now put the words in the document
        Selection.TypeText Text:=sDigits
        Selection.TypeText Text:=" "
        MsgBox "Number too large", vbOKOnly
    End If
End Sub

When using the macro, make sure that the number you are converting does not contain extraneous information, such as dollar signs or commas. When you run BigCardText, the macro checks to see if the selected number is over one million. If it is, it first works on the portion above one million, converting it to words. Then, the value below one million is converted. The final, full wording is put together and pasted back into the document, ready for use.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (203) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Converting Numbers to Text.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...


Functioning Check Boxes in a Protected Worksheet

Want to protect a worksheet but maintain the ability to make changes to the check boxes you add to the worksheet? Here is ...

Discover More

Can't Merge Alphanumeric Data Correctly

When you merge data from Excel into a Word document, you may need to do some conditional processing based on the data you are ...

Discover More

Quickly Finding Synonyms

If you need to find some synonyms for a specific word in your document, here's how you can do it. (Hint: All you need to do ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!


Determining if a File Exists

Your macro may need to know if a particular file exists. This is easy to figure out using the Dir command, and even easier if ...

Discover More

Changing the Default Drive

Macros can be used to read and write all sorts of files. If those files are on a different drive than the current one, you'll ...

Discover More

Converting Inches to Points

Typographical measurements are often expressed in points. There are several formatting settings that, when accessed through a ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments for this tip:

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 1?

2016-11-08 06:11:18

Ken Endacott

Paul. You have to select just the text to convert, the text must not have any non numeric words except that it can have the word 'and'. Thus if the text is 'one hundred and fifty three thousand four hundred and one dollars' you should select all except the word 'dollars'.

2016-11-07 11:22:27

Paul Naveen

Hi Endacott, if I run the macro, this is the message I'm getting. "Selection does not include a word". If I select a paragraph and run the macro, I'm getting this message. The word "" is non numeric. The word is quotes is the first word of the paragraph. Can you please provide a solution.

2016-11-04 05:27:52

Ken Endacott

Paul. See the macro in the comment below.

2016-11-03 08:44:17

Paul Naveen

I need a text to number macro. Can anybody help?

2016-04-11 08:11:13


can you please make it to be in uppercase format on the same above formula for converting number to text in word

2016-03-10 05:09:52


@Touseef, I've sent you a mail on how to do it. Please check your inbox.

2016-03-09 16:28:38


I am just wondering how to incorporate the above macro in my excel 2007 to use it? Plus when I copy it in VB it gives a syntex error.

Please help me.

2016-01-01 14:48:56


I build a (free) plugin if you need to convert numbers to text regularly in Word, focused on converting numbers in tables (has also some further features), feel free to use:

2015-05-26 05:59:56


@Varalaxmi: I've indicated a SpellNumber macro above that is used in MS Word. You will have to tweak it to show "Rupees" and "Paise" instead of "Dollars" and "Cents"

2015-05-25 05:43:01



2015-03-26 06:13:15

Ken Endacott

Converting in the other direction.

Here is a macro that will convert a text number such as 'one hundred million two thousand three hundred and forty-five' into 100,002,345. It will convert only whole numbers but could be modified to convert dollars and cents.

Sub TextToNumbers()
Dim NT() As Variant
Dim NB As Variant
Dim N As Long
Dim ns As String
Dim R As Range
Dim k As Long
Dim L As Long
Dim LL As Long
Dim LLL As Long
Dim s As String
Dim ss As String
Dim sss As String
Dim j As Long
Dim m As Long
Dim mm As Long
Dim mmm As Long
Dim gA() As Long
Dim gB() As Long
Dim isThousandsComma As Boolean

Dim wCount As Long
NT = Array("AND", "-", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN", _
NB = Array(0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, _
11, 12, 13, 14, 15, 16, 17, 18, 19, _
20, 30, 40, 50, 60, 70, 80, 90, _
100, 1000, 1000000, 0)

isThousandsComma = True ' set to false for no commas

Set R = Selection.Range
s = R.Text
If Right(s, 1) = Chr(13) Then R.MoveEnd Unit:=wdCharacter, Count:=-1
s = R.Text
If Right(s, 1) = "." Then R.MoveEnd Unit:=wdCharacter, Count:=-1

If R.Paragraphs.Count > 1 Then
MsgBox "Selection cannot span paragraphs"
Exit Sub
End If
If Trim(R.Text) = "" Then
MsgBox "Selection does not include a word"
Exit Sub
End If

wCount = R.Words.Count
ReDim gA(wCount + 1)
ReDim gB(wCount + 1)

N = 0
ns = ""

For k = 1 To R.Words.Count
s = UCase(Trim(R.Words(k)))
If s = Chr(13) Or s = "" Then
gB(k) = 1
gA(k) = 0
GoTo FF2
End If
For m = 0 To UBound(NT) - 1
If s = NT(m) Then GoTo FF
Next m
MsgBox "The word " & """" & R.Words(k) & """" & " is non numeric"
Exit Sub
gA(k) = NB(m)
If m > UBound(NT) - 5 Then
gB(k) = 2
gB(k) = 1
End If
Next k

wCount = removeZeros(gA(), gB(), wCount)

For k = 1 To wCount - 1
If gB(k) = 1 And gB(k + 1) = 1 Then
gA(k + 1) = gA(k + 1) + gA(k)
gA(k) = 0
End If
Next k
wCount = removeZeros(gA(), gB(), wCount)

m = 1
m = m + 1
Loop Until m > wCount Or gA(m) = 1000000
If m <= wCount Then ' 1000000 is at ga(m)
' check that there are no 1000s
j = 1
j = j + 1
Loop Until j >= m Or gA(j) = 1000
If j < m Then
MsgBox "Cannot process thousands of millions"
Exit Sub
End If
j = 1
j = j + 1
Loop Until j >= m Or gA(j) = 100
If j < m Then
gA(j) = gA(j) * gA(j - 1)
gA(j - 1) = 0
gB(j) = 1
End If
LL = 0
For j = 1 To m - 1
L = L + gA(j)
gA(j) = 0
gB(j) = 0
Next j
gA(m) = L * gA(m)
gB(m) = 1
m = 0
End If ' 1000000 processed

mm = j + 1
If mm <= wCount Then
mm = mm + 1
Loop Until mm > wCount Or gA(mm) = 1000
End If
If mm <= wCount Then ' 1000 is at ga(mm)
j = m + 1
j = j + 1
Loop Until j >= mm Or gA(j) = 100
If j < mm Then ' have 100 preceeding 1000
gA(j) = gA(j) * gA(j - 1)
gA(j - 1) = 0
gB(j) = 1
End If
LL = 0
For j = m + 1 To mm - 1
LL = LL + gA(j)
gA(j) = 0
gB(j) = 1
Next j
gA(mm) = LL * gA(mm)
gB(mm) = 1
mm = m
End If ' 1000 is at mmth entry

mmm = mm + 1
If mmm <= wCount Then
mmm = mmm + 1
Loop Until mmm > wCount Or gA(mmm) = 100
End If
If mmm <= wCount Then ' 100 is at ga(mmm)
gA(mmm) = gA(mmm - 1) * gA(mmm)
gA(mmm - 1) = 0
gB(mmm) = 1
mm = m
End If ' 100 is at mmmth entry

LLL = 0
For j = 1 To wCount
LLL = LLL + gA(j)
Next j

If isThousandsComma Then
s = Format(LLL, "Standard")
s = Left(s, Len(s) - 3)
s = Str(LLL)
End If

R.Text = Trim(s)
End Sub

Function removeZeros(gA() As Long, gB() As Long, ByVal wCount As Long) As Long
Dim q As Long
Dim z As Long
For q = wCount To 1 Step -1
If gA(q) = 0 Then
z = q
Do While z < wCount
gA(z) = gA(z + 1)
gB(z) = gB(z + 1)
z = z + 1
wCount = wCount - 1
End If
Next q
removeZeros = wCount
End Function

2015-03-25 13:57:38

Manuel Campos

I need Converting Numbers to Text

example: 1234 Converting one,two,three, four


2014-07-01 07:09:40


There is a SpellNumber function on the MS website

2014-05-26 09:39:14


Nabil: The language used for Excel macros is VBA (Visual Basic for Applications). Other languages (such as C or C++) would not be understood by Excel.


2014-05-25 22:51:12


ms excel is not a compiler. But how does the code run in ms excel? am i able to run any type of c or c++ code in excel??

2013-05-08 06:53:49


I need to know how to convert 1234.57 into words eg. One Thousand Two Hundred Thirty Four And Fifty Seven Cents.... How can I do that after?

And after using mail merge, the amount of 1234.57 became 1234.567655555555322389

How can i format it to be 1,234.57?


2013-04-30 14:20:16

Steven Seim

Additional - The request is to deal with monetary values such as:


Convert to:

One Hundred Twenty Three Thousand, Four Hundred Fifty Six dollars and Seventy Eight Cents. (First letter caps)


2013-04-30 14:12:52

Steven Seim

Hello. This macro is spiff, but I have a question/favor to ask.

Can this be adjusted to work with punctuation?

Example: 123,456.78

Let me know please. I could use this.

Many thanks!

2012-02-28 22:12:32

Ernest Dehaan

Does this work on formulas? I ask because I tried and did not get any results.

If it does work in formuals where would it get inserted.

Newest Tips

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.

Links and Sharing