Microsoft KB Archive/137526

= How to Add a New Category to Function Category List =

Article ID: 137526

Article Last Modified on 10/11/2006

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0 Standard Edition
 * Microsoft Excel 98 for Macintosh

-



This article was previously published under Q137526





SUMMARY
To manually create a custom category for a user-defined function that you write in Microsoft Visual Basic for Applications, you must insert a Microsoft Excel 4.0 macro sheet before you create the category.



MORE INFORMATION
To create a custom category, follow these steps:
 * 1) In Microsoft Excel 97, right-click a sheet tab in the workbook and click Insert. In Microsoft Excel 98 Macintosh Edition, hold the Control key and click a sheet tab in the workbook and click Insert. Click MS Excel 4.0 Macro and click OK to add a macro sheet to the workbook.

In Microsoft Excel 5.0 and 7.0, point to Macro on the Insert menu, and click MS Excel 4.0 Macro to add a macro sheet to the workbook.
 * 1) On the Insert menu, point to Name, and then click Define. Under Macro, click Function.
 * 2) In the Name box, type TEST1.
 * 3) In the Category box, replace "User Defined" with the new category, and then click OK.

Microsoft Excel adds the new category to the list. After you add one or more custom functions to the new category, you can delete the "TEST1" function name. When you do this the new category remains. If you delete the Microsoft Excel 4.0 macro sheet, functions already assigned to the custom category remain in that category; however, you cannot assign a new function to that category after you delete the macro sheet.

Excel 97 for Windows and Excel 98 Macintosh Edition
You cannot add a user-defined function to a specific category by selecting the function in a dialog box. You must use a macro to specify a category for the function. For additional information, please see the following article in the Microsoft Knowledge Base:

157108 Options not Available in Macro Options Dialog Box

Microsoft Excel 5.0 and 7.0
To specify a category for a user-defined function, follow these steps:
 * 1) With a module sheet active, press F2 to start the Object Browser
 * 2) Select the workbook in the Libraries/Workbooks list.
 * 3) Select the custom function in the Methods/Properties list, and then click Options.
 * 4) Select the category in the Function Category list, and then click OK.
 * 5) Click Close to close the Object Browser.

