To convert a numeric value into written text in Excel, you must use a Custom VBA Function (User Defined Function) because Excel does not have a built-in formula for this specific task. By adding a small script to your workbook's VBA editor, you can create a custom formula like =SpellNumber(A1) that instantly converts numbers like 125.50 into "One Hundred Twenty Five Dollars and Fifty Cents."

What You'll Need

  • Microsoft Excel installed on a Windows or Mac computer.
  • The ability to enable the "Developer" tab in the Excel Ribbon.
  • A workbook saved in a macro-enabled format (.xlsm or .xlsb).

Step-by-Step

  1. Enable the Developer Tab: If you do not see the Developer tab at the top of your Excel ribbon, right-click any existing tab (like Home or Insert) and select "Customize the Ribbon." In the right-hand list of main tabs, check the box next to "Developer" and click OK. Note that menu labels may vary slightly depending on your version of Excel.
  2. Open the Visual Basic Editor: Click on the Developer tab and then click the "Visual Basic" button on the far left. Alternatively, you can use the keyboard shortcut Alt + F11 on Windows or Option + F11 on a Mac. This will open a new window separate from your spreadsheet.
  3. Insert a New Module: In the Visual Basic Editor window, look at the top menu bar. Go to Insert > Module. This creates a blank white workspace where your code will live. It is important to insert a Module rather than pasting code into "ThisWorkbook" or a specific "Sheet" object, as a Module makes the function available to the entire workbook.
  4. Paste the VBA Code: Copy a standard "SpellNumber" VBA script from a trusted source (such as Microsoft's official documentation or reputable developer forums). Since the code is quite long, ensure you copy the entire block from the first "Function" declaration to the final "End Function" statement. Paste this directly into the empty white Module window you just created.
  5. Save as Macro-Enabled: Close the Visual Basic Editor window to return to your Excel spreadsheet. Now, go to File > Save As. In the file type dropdown menu, you must select "Excel Macro-Enabled Workbook (*.xlsm)". If you save it as a standard .xlsx file, all the code you just pasted will be permanently deleted when you close the file.
  6. Apply the Function: In any cell in your spreadsheet, type the formula =SpellNumber(A1), where A1 is the cell containing the numeric amount you wish to convert. Press Enter, and the text version of the number should appear.

Common Mistakes

The most frequent error is saving the file as a standard Excel workbook (.xlsx). Many users spend time writing and perfecting complex VBA scripts only to find that upon reopening the file, the functions return a #NAME? error. This happens because .xlsx files are strictly prohibited from containing macros for security reasons. Always verify your file extension is .xlsm.

Another common mistake is attempting to use the function in a workbook where macros have been disabled by security settings. When you open a macro-enabled file, Excel usually displays a yellow security warning bar at the top of the screen that says "Macros have been disabled." You must click "Enable Content" for the SpellNumber function to work. If you ignore this, the formula will not be recognized.

Users also often struggle with decimal precision. If your VBA code is designed specifically for currency (Dollars and Cents), it may not work correctly for other types of numbers, such as metric measurements or pure integers. Always check the logic within the code to see if it is hard-coded to include currency symbols or specific decimal terminology.

Tips

If you need to use this function across multiple different Excel files, do not copy the code into every single file. Instead, save the code in your "Personal Macro Workbook" (Personal.xlsb). This is a hidden workbook that opens every time you launch Excel, making your custom functions globally available on your local machine without needing to repeat the setup process for every new project.

For better presentation, combine your VBA function with Excel's PROPER or UPPER functions. For example, =PROPER(SpellNumber(A1)) will ensure that the first letter of every word is capitalized, which is often required for formal checks or legal documents. If you need the text in all caps, use =UPPER(SpellNumber(A1)).

When writing or selecting code, look for a version that includes a "Cent" or "Decimal" toggle. Some scripts are optimized for large numbers (billions and trillions), while others are simpler and only handle up to millions. Choose the version that matches the scale of the financial data you handle most frequently.

Troubleshooting

If you see the #NAME? error, it means Excel does not recognize the word "SpellNumber" as a valid function. This usually happens for one of three reasons: the code was not pasted into a Module, the code was pasted into a Sheet object instead of a Module, or the file was saved as an .xlsx file. Re-open the VBA editor (Alt + F11) and ensure the code is visible within a folder named "Modules" in the Project Explorer on the left.

If the function returns #VALUE!, there is an issue with the data in your source cell. The VBA script expects a numeric value. If your cell contains a number formatted as text (often indicated by a small green triangle in the corner of the cell), the script may fail. To fix this, select the cell, click the warning icon, and select "Convert to Number," or use the =VALUE() function to clean the data first.

If the code produces incorrect wording (e.g., saying "One Hundred and Two" when you want "One Hundred Two"), you must edit the VBA code itself. Look for the section of the code that handles the word "and" or the decimal separator. You can manually add or remove strings of text within the quotation marks in the VBA editor to match your regional preference (e.g., British English vs. American English).

If the VBA window is missing, ensure you are looking at the "Project Explorer" (View > Project Explorer) and the "Properties Window" (View > Properties Window). These sidebars are essential for navigating your different modules and sheets.

Frequently Asked Questions

Does this work on Excel for Web?

No, VBA (Visual Basic for Applications) is a desktop-based technology. While you can view files containing macros in a web browser, the actual code will not execute. You must use the desktop version of Excel to run custom VBA functions.

Can I use this on a Mac?

Yes, VBA is supported on Excel for Mac. However, the keyboard shortcuts are different (use Option + F11), and the user interface for the Developer tab may look slightly different than the Windows version.

Will my macro work if I send the file to someone else?

Yes, as long as you save the file as an .xlsm workbook. When the recipient opens the file, they will see a security prompt asking them to "Enable Content." Once they click that, the function will work perfectly on their computer.

Is it safe to use VBA code from the internet?

You should only use code from highly reputable sources like Microsoft or well-known developer communities. While simple functions like SpellNumber are generally safe, macros can be used to run malicious commands. Always read through the code to ensure it only contains logic related to text conversion.

Can I change the currency from Dollars to Pounds?

Yes. You will need to open the VBA editor, find the lines of code that contain the words "Dollar" and "Cent," and manually replace them with "Pound" and "Penny" (or your preferred currency terms). Be sure to handle both singular and plural forms (e.g., "One Dollar" vs "Two Dollars") to ensure grammatical accuracy.