Save a Number-to-Words VBA Function Permanently in Excel
Question details
Keep a custom number-to-words VBA function saved and available across Excel worksheets.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- The user wants to convert numbers into words in any worksheet without repeatedly adding the VBA code.
- Observed behavior
- The pasted VBA module is no longer available after the workbook is closed.
Have the working VBA function code ready and check its function name. If the Developer tab is hidden, enable it through File > Options > Customize Ribbon.
Save the function in Personal Macro Workbook
Use PERSONAL.XLSB to load the function whenever Excel starts on your computer.
If you do not already have one, select Developer > Record Macro, choose Personal Macro Workbook under Store macro in, and click OK. Then select Developer > Stop Recording.
Open Developer > Visual Basic. In the Project Explorer, select VBAProject (PERSONAL.XLSB), choose Insert > Module, and paste the function into the standard module.
In the VBA editor, select the PERSONAL.XLSB project and choose File > Save PERSONAL.XLSB. When closing Excel, save the personal workbook if prompted.
Restart Excel and enter a formula such as =PERSONAL.XLSB!NumberToWords(A1), replacing NumberToWords with the actual function name. Allow trusted macros if Excel prompts you.

Create and enable an Excel add-in for the function
Use an add-in when you want to load the function separately from individual workbooks.
Work with spreadsheets in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility, making it easy to move everyday spreadsheet work between suites. Excel-specific VBA behavior may differ.

Frequently Asked Questions
Why did my VBA function disappear after I closed the workbook?
The code may not have been saved in a macro-enabled file. Save a workbook containing VBA through File > Save As using Excel Macro-Enabled Workbook (*.xlsm), or store the function in PERSONAL.XLSB or an .xlam add-in.
Why does my formula include PERSONAL.XLSB?
A function stored in the personal workbook can be called from another workbook with a reference such as =PERSONAL.XLSB!NumberToWords(A1). Replace the function name with the one used in your code.
Will the function work when I send the workbook to someone else?
Not automatically if the function is only in your PERSONAL.XLSB or a local add-in. The recipient also needs the function code or the add-in and must allow its macros.
Why does Excel show an error after I save the function?
Check that the function name in the formula matches the VBA code, that the code is in a standard module, and that PERSONAL.XLSB or the add-in is loaded. Also check Excel's macro security prompts and enable only code you trust.




