Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


How to tell word to spell out a number in digits

Posted on 2014-11-26
Medium Priority
Last Modified: 2014-11-27
I have a very large amount of numbers in word that needs to be presented in both ways, numbers and spelled out. All the numbers are present in digits, but so far I need to type them manually to have them spelled out. Is there a way to automatically do this?
Question by:mvp1985
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
LVL 24

Expert Comment

ID: 40466630
There is no way to do it natively in word. You will have to use this macro.
LVL 14

Expert Comment

ID: 40466635
Open the VBA editor and put this into your document's or macro code:

Sub Digits2Numbers()

    Dim digits As String
    Dim spelled As String
    digits = Selection.Text
    spelled = "#"
    For i = 1 To Len(digits)
        If i > 1 And Len(digits) > 1 Then spelled = spelled + "-"
        Select Case Mid(digits, i, 1)
        Case "0"
            spelled = spelled + "Zero"
        Case "1"
            spelled = spelled + "One"
        Case "2"
            spelled = spelled + "Two"
        Case "3"
            spelled = spelled + "Three"
        Case "4"
            spelled = spelled + "Four"
        Case "5"
            spelled = spelled + "Five"
        Case "6"
            spelled = spelled + "Six"
        Case "7"
            spelled = spelled + "Seven"
        Case "8"
            spelled = spelled + "Eight"
        Case "9"
            spelled = spelled + "Nine"
        Case "."
            spelled = spelled + "Dot"
        Case ","
            spelled = spelled + "Comma"
        Case "$"
            spelled = spelled + "Dollar"
        Case " "
            spelled = spelled + "Space"
        Case "-"
            spelled = spelled + "Minus"
        Case "+"
            spelled = spelled + "Plus"
        Case Else
            spelled = spelled + "???"
        End Select
    Next i
    spelled = spelled + "#"

    Dim objClipboard As Object
    Set objClipboard = CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
    objClipboard.SetText spelled
    Set objClipboard = Nothing
End Sub

Open in new window

Add the macro to your menu strip and/or assign a shortkey combination to it.


Type the number you want to convert, and select it. Run the macro. The converted number will be in the clipboart afterwards. To replace the number just type CRTL-V afterwards, since the number string is already selected. To use it elsewhere, just navigate to theright spot and press CTRL-V there.


     123456 78,90.5x+-

would return in the clipboard


For different start/end coding and separator just adjust the strings in the code ...

By the way that macro is independent to the number's length ... and with some more things in the select statement it could even be used tor translating text into a phonetic alphabet (Alpha, Bravo, Charlie, Delta, Echo, ... see here for more info).
LVL 24

Expert Comment

ID: 40466677
Experiment with this ....

Select a number in word (e.g. 2750)
Press Ctrl+F9 to embed it in a field.
Use Alt+F9 to show/hide the field as necessary.

Edit the field to match the following format:
{=VALUE \* CardText}      that is .... {=2750 \* CardText}

Press F9 to update the field.    Result = two thousand seven hundred fifty
[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

LVL 76

Expert Comment

ID: 40466718
Missed your welcome later contribution.
LVL 24

Expert Comment

ID: 40466744
Point noted and taken on board GrahamSkan
LVL 21

Accepted Solution

Eric Fletcher earned 2000 total points
ID: 40468426
Depending on how the numbers are presented, consider using the CardText formatting switch with in a field code.

For example, if your numbers were able to be referenced using MailMerge as, say, a variable names "Amount", you could use a field code with switches like this: {MERGEFIELD "Amount" \*CardText } to display a result like one thousand five hundred seventy-one (see image below)). Many formatting switches are available to manage how values are displayed with many of Word's field codes. See the Microsoft article here (Insert and format field codes in Word 2010; the same switches are available in older and newer versions).

The screen captures below show the merge codes first as seen in MailMerge; then as field codes (press Alt-f9 to toggle the view); and then as displayed when  the merged value of Amount was 1,570.76 (note the rounding in the CardText examples).
Field code switches to spell out numbersThe grey shading in the samples above identifies field codes and their results in the screen view (i.e. it won't be printed). This visibility is very useful to be able to detect content that is a result of a field code calculation amongst normal typed content. I always have it turned on: File Options > Advanced > Show document content, Field shading=Always.
LVL 21

Expert Comment

by:Eric Fletcher
ID: 40468445
An addendum to my comment above: If you want to have the field code results converted to text instead of existing as calculated field codes, select the results and press Ctrl-Shift-F9. For the mail merge field codes, just run the "Finish & Merge" to produce a new document with the values.

Author Comment

ID: 40468743
The {MERGEFIELD "Amount" \*CardText } works perfect and is exactly what I need. But how can I assign the previous form field instead of "Amount"? This is important, since I run a macro on exiting the form field that has the number in digits, that unprotected the document, pastes a new page with the same form fields and text, and then re-protects the document.

Since the price is always different on each document page, but the formfield that contains the correct digits is always the one before the spelled out number, I know bookmarks would not work, unless there is a way to create a bookmark every time the makro runs upon exiting the price form field.
Any suggestions on this?
LVL 21

Expert Comment

by:Eric Fletcher
ID: 40469113
I'm not sure I follow what you need to do here. Can you post an example?

The format switches will work with any field code that can return a numeric value, but you'd need to find away to refer to the value in some way with a field code. Perhaps the STYLEREF could be used if you can have the value from the formfield result tagged with a style as shown below.
Using STYLEREF to report a value as cardinal textFor clarity, I captured the 1st screen shot in the Draft mode so the paragraph style names would be shown in the style area pane on the left (File Options > Advanced > Display, Style area pane width in Draft and Outline views). The style pane will only show the style name associated with paragraphs, so I set the character style colour to brown to make it more visible. This can be handy for testing, and you can change the style's colour back to Auto once you know it works okay.

Author Comment

ID: 40469371
Basically I am developing a word document that is used for evaluations of art and jewelery for which i use form fields and text describing what goes into the form field. I do this so I can quickly enter the text and then just advance with the tab key. Since every customer is different, I don't know ho many items I need to evaluate, so I use a macro, which runs at the exit of the last form field on the page, that enters a page break, and the same form fields and descriptions (in order for this to work, the macro unprotects the document, and later protects it again, so I can use tab again).  The last item I enter is the estimated price of the piece, but for legal purposes I also need to enter it in non-numerical form right beneath the numerical form. (so for example:

 Estimated price: $40.00
                                 Forty US Dollar

The mergefield you mentioned earlier works perfectly when I enter the number into the "amount" when I establish the meregield. But, since I have often hundreds over hundreds of these prices, I would love for a way that it is automated completley, and all I need to do is put the numerical price in, and the non-numerical amount is automatically entered below. So yes, I need to find a way to refer to the numeric value somehow. Any suggestions on how to refer automatically?

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It is often necessary in this forum and others to illustrate Word fields as text with the field delimiters replaced with the curly brackets that the delimiters resemble when field codes are being displayed on the document. This means that the text c…
If you work with Word a lot, you probably use styles. If you use styles a lot, you've probably balled your fist more often than not when working with the ribbon. In Word 2007/2010, one of the things that I find missing when using styles is a quic…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.
In a previous video Micro Tutorial here at Experts Exchange (, I explained how to get a free, one-month trial of Office …

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question