Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding help to Excel user defined function

Status
Not open for further replies.

bpeirson

Technical User
Sep 28, 2005
85
0
0
CA
I am wondering if I can add helpful tips to my user defined functions in excel. Currently the "Insert Function" dialog says "No help available." I would like to change all that.

I searched the forum archives and found a similar question from 2004 but there was no response at that time. Surley by now there has been added functionality to user defined functions and/or everyone here has more experience with excel now.

I will accept imaginative work arounds as well, I am considering using descriptive variables. As an example in a polar coordinate conversion function x will be "X_coordinate", and in the inverse function (Polar to cartesian) theta will be "Counter_clockwise_angle_from_horizon".
 
bpeirson

Try this, it may be what you are looking for...

Code:
There are at least 2 ways you can use to add a description to you UDF's, one is relatively well known, while the other is a simple but little known method. Lets use the better known method first. 

1. Open up the VBE (Alt+F11) and select anywhere within your Function code.

2. Now Push F2 to open the "Object Browser".

3. At the top of the Object Browser there are 2 drop down boxes. Click the top one and select "VBAProject".

4. You should now have all Modules and global Objects showing in the "Classes" box situated at the bottom of the Object Browser.

5. Click on the name of the Module that houses your UDF.
6. In the "Members of..." box to the right you should see the names of all Functions and Procedures within the selected Module.

7. Simply right click on the name of your UDF and select "Properties".

8. Type a description for your UDF, then click Ok and then Save.

********************************** OR **********************

Here is the little known method. This is best done before you write your UDF.

1. Go to Tools>Macro>Record new macro. 

2. In the Description box, type a description for your UDF. Type the name of your UDF and click Ok. 

3. Now Stop recording. 

4. Open the VBE (Alt+F11) and replace the word "Sub" with "Function" 

5. Add your Function arguments as normal.

Hope this helps...

 


Another way...

Code:
You can see that the user defined functions lack any description other than the unhelpful "No help available" message, but you can add a short description...

Make sure you are in the workbook that contains the functions. Go to Tools > Macro > Macros. You won't see your functions listed here but Excel knows about them! In the Macro Name box at the top of the dialog, type the name of the function, then click the dialog's Options button. If the button is greyed out either you've spelled the function name wrong, or you are in the wrong workbook, or it doesn't exist! This opens another dialog into which you can enter a short description of the function. Click OK to save the description and (here's the confusing bit) click Cancel to close the Macro dialog box. Remember to Save the workbook containing the function. Next time you go to the Function Wizard your UDF will have a description...
 
Hey thanks for the links guys, this may solve a problem I'm currently having too.

"If you can stay calm, while all around you is chaos...then you probably haven't completely understood the seriousness of the situation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top