How to convert number to words in Word document?

This article is talking about the method on converting the numbers to English words in Word document, please go on to view the details if you are interested in.

Convert number to English words with VBA

Easily Split one word document into multiple

Generally, we use copy and paste to split a Word document one by one, but the Split Documnet utility can split a Word document based on page, heading1, page break or section break, which will improve the work efficience .  Click for 45 days free trial!
ad split documents by page
Kutools for Word: with hundreds handy Word add-ins, free to try with no limitation in 45 days.

Convert number to English words with VBA

1. Select the number you want to convert to words, press Alt + F11 keys to open Microsoft Visual Basic for Applications window.

2. Click Insert > Module, and copy below codes and paste them to the Module script.

VBA: Convert number to words

Sub ConvertNumberToWord()
    Dim xDigit As Double
    Dim xBuff As String
    On Error Resume Next
    Selection.MoveLeft wdWord, 1, wdMove
    Selection.MoveRight wdWord, 1, wdExtend
    xDigit = Val(Trim(Selection.Text))
    If xDigit = 0 And Str(xDigit) <> Trim(Selection.Text) Then Exit Sub
    If xDigit > 999999 Then
        If xDigit <= 999999999 Then
            xBuff = Trim(Int(Str(xDigit / 1000000)))
            Selection.Fields.Add Selection.Range, wdFieldEmpty, "= " + xBuff + " \* CardText", True
            Selection.MoveLeft wdWord, 1, wdExtend
            xBuff = Selection.Text & " million "
            xDigit = Right(Str(xDigit), 6)
        End If
    End If
    If xDigit <= 999999 Then
        Selection.Fields.Add Selection.Range, wdFieldEmpty, "= " + Str(xDigit) + " \* CardText", True
        Selection.MoveLeft wdWord, 1, wdExtend
        xDigit = xBuff & Selection.Text
        Selection.TypeText xDigit + " "
        MsgBox "Number too large", vbOKOnly, "Kutool for Word"
    End If
End Sub

3. Press F5 key to run the code, now the number has been converted to words.
doc number to word 1

Note: The code only work at one number each time.

Tabbed browsing & editing multiple Word documents/Excel workbooks as Firefox, Chrome, Internet Explore 10!

You may be familiar to view multiple webpages in Firefox/Chrome/IE, and switch between them by clicking corresponding tabs easily. Here, Office Tab supports similar processing, which allow you to browse multiple Word documents or Excel workbooks in one Word window or Excel window, and easily switch between them by clicking their tabs.
Click for free trial of Office Tab!

Browse multiple word documents in one window as Firefox

Recommended Word Productivity Tools


Kutools For Word - More Than 100 Advanced Features For Word, Save Your 50% Time

  • Complicated and repeated operations can be done one-time processing in seconds.
  • Insert multiple images across folders into Word document at once.
  • Merge and combine multiple Word files across folders into one with your desired order.
  • Split the current document into separate documents according to heading, section break or other criteria.
  • Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.