MrExcel Publishing
Your One Stop for Excel Tips & Solutions

User Defined Functions

Posted by giacomo on October 31, 2001 7:22 AM

How can I add comments to my user-defined functions that are displayed in the function box? I have some functions that I want to distrubute to my co-workers and I need to add some descriptors that explain what type of data should be entered as arguments.


Posted by Ken on October 31, 2001 8:19 AM

In VB Editor press F2 to activate Object Browser, select your workbook from the Project drop down list, In the classes window select the module that contains the funtion. In the members window select the function, right click the function and select properties from the shortcut menu, Under description you can add comments to your funtion,

you will need lines of code in your function to refer to your help menu if you want that too.
Such as
HelpContextID:=1, _
HelpFile:=ThisWorkbook.Path & "\Customfunction.hlp"


Posted by giacomo on October 31, 2001 8:38 AM

Thanks! one more question...

Is there any way I can add comments to each individual argument.


Posted by Ken on October 31, 2001 2:49 PM

Re: Thanks! one more question...

Add this macro in the workbook you have the function in

Sub Descriptions()
Application.MacroOptions Macro:="Yourfunctionnamehere", _
Description:="The decription you want to add"
End Sub