VBA & Macro Problems

Save a Number-to-Words VBA Function Permanently in Excel

Jason MillerJason Miller Nov 25, 2026 869 views

Question details

Keep a custom number-to-words VBA function saved and available across Excel worksheets.

Save a Number-to-Words VBA Function Permanently in Excel
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.
Before you start

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.

Solution 1Recommended

Save the function in Personal Macro Workbook

Use PERSONAL.XLSB to load the function whenever Excel starts on your computer.

1
Create the personal workbook

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.

2
Add the function code

Open Developer > Visual Basic. In the Project Explorer, select VBAProject (PERSONAL.XLSB), choose Insert > Module, and paste the function into the standard module.

3
Save the workbook

In the VBA editor, select the PERSONAL.XLSB project and choose File > Save PERSONAL.XLSB. When closing Excel, save the personal workbook if prompted.

4
Call the function

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.

Save the function in Personal Macro Workbook
Availability: PERSONAL.XLSB is stored on your computer, not inside every workbook. A workbook that calls its function will need access to the same function on another computer.
Free Microsoft Office alternative

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.

Open and edit spreadsheets in a familiar interfaceWork with Microsoft Excel formats such as XLSXUse spreadsheet formulas for everyday calculationsMove common Office documents into a lightweight suite
microsoft office alternative - wps office

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.