Microsoft KB Archive/102944

= Microsoft Knowledge Base =

Excel: Defined Names Are Not Deleted Dynamically
Last reviewed: December 17, 1996

Article ID: Q102944

The information in this article applies to:


 * Microsoft Excel 97 for Windows
 * Microsoft Excel for Windows 95, version 7.0
 * Microsoft Excel for Windows, versions 2.x, 3.x, 4.x, 5.0, 5.0c
 * Microsoft Excel for the Macintosh, versions 2.x, 3.x, 4.x, 5.0 5.0a
 * Microsoft Excel for Windows NT, version 5.0

SUMMARY
In Microsoft Excel, you can define a name to refer to a cell range, a command macro, a custom function, a variable or a constant. If you then use a different name to refer to the same element, the previous name will not be deleted.

To remove a previously defined name that you no longer use:

Microsoft Excel version 5.0 and later

 * 1) On the Insert menu point to Name and then click Define.
 * 2) In the Define Name dialog box select the name you want to delete and then click Delete.
 * 3) Click OK.

Microsoft Excel version 4.0

 * 1) Choose Define Name from the Formula menu.
 * 2) Select the name you want to remove, choose the Delete button, and then choose OK.

A similar situation occurs when you use the REGISTER function in a macro to register a dynamic link library (DLL) or code resource. If you specify a name for the function_text argument, this name is added to the Paste Function and Define Name dialog boxes. If you then run the REGISTER function again with a new function_text argument, the previous name will remain and the new one will be added.

To properly remove a registered function, first use the UNREGISTER function to free the memory that is allocated to it. Since UNREGISTER does not remove the name from the Paste Function or Define Name dialog boxes, you must manually delete it from the Define Name dialog box.