How to Set Up the SpellNumber Function in Excel 2019
Question details
The user needs to convert numeric values into written words using the custom SpellNumber VBA function in Excel 2019.

- Product
- Excel 2019
- Device & OS
- not provided
- Scenario
- Converting numerical data, such as currency, into text format for checks or official documents.
- Observed behavior
- The user wants to implement and successfully run a VBA macro to utilize the SpellNumber function within a macro-enabled workbook.
Ensure that the Developer tab is enabled in your Excel ribbon, as you will need to access the Visual Basic for Applications (VBA) editor to insert the custom code.
Add the SpellNumber Function via the VBA Editor
Since SpellNumber is not a built-in feature, you must add it manually by pasting a specific VBA script into a new module in your workbook.
To make Excel convert numbers into text words (e.g., 22.50 to Twenty-Two Dollars and Fifty Cents), you need to utilize Microsoft's custom SpellNumber code.
Open your Excel workbook and press 'Alt + F11' on your keyboard to launch the Visual Basic for Applications (VBA) editor.
In the VBA editor, click on 'Insert' in the top menu bar, and then select 'Module'. This will open a blank text window.
Copy the official SpellNumber VBA code provided in Microsoft's support article and paste it directly into the blank module window.
Close the VBA editor by pressing 'Alt + Q' to return to your normal Excel worksheet.
Select a blank cell and type '=SpellNumber(A1)' (replace A1 with the cell containing your number) and press Enter. The number will now be displayed as text.
Go to File > Save As. In the 'Save as type' dropdown, select 'Excel Macro-Enabled Workbook (*.xlsm)'. This ensures the function remains active the next time you open the file.

Run VBA Macros Smoothly with WPS Office
WPS Spreadsheet fully supports VBA macros, allowing you to insert, edit, and run custom scripts like the SpellNumber function. Enjoy a lightweight application that handles macro-enabled workbooks effortlessly while maintaining high compatibility with Excel formats.
- 1. Launch WPS Spreadsheet: Open your workbook in WPS Office and navigate to the 'Developer' tab on the ribbon.
- 2. Access the VBA Editor: Click the 'VBA Editor' icon or press Alt + F11 to open the macro environment.
- 3. Insert the Code: Go to Insert > Module, paste your SpellNumber script, and close the editor.
- 4. Apply and Save: Use the =SpellNumber() formula in your sheets and save your document as a Macro-Enabled Workbook.

Frequently Asked Questions
Why does my SpellNumber function display a #NAME? error?
This error usually occurs if the macro was not properly saved into the workbook, or if macros have been disabled in your Excel Trust Center settings. Ensure your file is saved as an .xlsm and you clicked 'Enable Content' upon opening.
Is there a way to convert numbers to words without using VBA?
Currently, Excel does not offer a native, built-in function to spell out numbers. Using VBA to add the custom SpellNumber function is the only official method for completing this task directly within Excel.
Can I modify the SpellNumber code for different currencies?
Yes. The standard Microsoft code is tailored for Dollars and Cents. By editing the text strings within the VBA module (for example, replacing 'Dollars' with 'Pounds'), you can customize the output for your specific currency.
Will the SpellNumber function work in other Office versions?
Yes, the SpellNumber VBA script works consistently across multiple versions of Excel, including Office 2016, 2019, 2021, and Microsoft 365, as long as macros are supported and enabled.




