+ Reply to Thread
Results 1 to 16 of 16

Adding help text to a user-defined function

  1. #1
    Registered User
    Join Date
    08-03-2005
    Location
    Costa Rica
    Posts
    3

    Adding help text to a user-defined function

    Hello,

    can anyone tell me if there's a way to add help text to a user-defined function, so it is visible when clicking INSERT - FUNCTION?

    Thanks.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827
    I don't know if this is exactly what you want, but here's what I've done for my UDF's:

    1) From VBA editor, open object browser.
    2) Find UDF name and right click -> select properties
    3) One of the text boxes in this dialog is called "description" Put your desired text in that box.

    I don't know that you'll have enough text to completely describe how to use the function, but it would be enough to help someone who's already familiar with how to use it.

  3. #3
    Registered User
    Join Date
    08-03-2005
    Location
    Costa Rica
    Posts
    3

    Question Not exactly what I was looking for

    It's not quite what I was looking for.

    I was hoping I could change the "No help available" text, displayed in the "Function Arguments" dialog box that pops up when accessing the UDF by: INSERT - FUNCTION - CATEGORY - USER DEFINED ... etc.

    Do I need to create a help file for this? If so, where would I insert it?

    Thanks again.

  4. #4
    Forum Contributor
    Join Date
    11-11-2005
    Posts
    267
    You can use Windows API call. But that is not simple.
    HTH
    Myles

    ...constantly looking for the smoother pebble while the whole ocean of truth lies before me.

  5. #5
    Registered User
    Join Date
    05-14-2007
    Posts
    2
    Quote Originally Posted by MrShorty
    I don't know if this is exactly what you want, but here's what I've done for my UDF's:

    1) From VBA editor, open object browser.
    2) Find UDF name and right click -> select properties
    3) One of the text boxes in this dialog is called "description" Put your desired text in that box.

    I don't know that you'll have enough text to completely describe how to use the function, but it would be enough to help someone who's already familiar with how to use it.
    I've tried this a few times and sometimes it works and sometimes the new desicription does not appear. Do you have any ideas why this could be and how I can fix it? It gets a bit tedious entering the same description again and again.

    Thanks

  6. #6
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon MalcolmK

    ...and welconme to the forum!

    A word of advice, in future if you're going to ask questions, you have more chance of a reply if you start a thread of your own for the question, rather than tack it on to the end of someone elses.

    To answer your question, why not use code to do it? Go to the VBE and press Ctrl + g to open the immediate window and type in :
    Please Login or Register  to view this content.
    When you save the workbook, this information will be saved with your UDF.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  7. #7
    Registered User
    Join Date
    05-14-2007
    Posts
    2
    Hi DominicB

    Thanks for the help

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    You can do this before you write your UDF,

    Go to Tools>Macro>Record New Macro.
    In the Description box, type a description for your UDF. Type the name of your UDF and click Ok.
    Now Stop recording.
    Open the VBE (Alt+F11) and replace the word "Sub" with "Function"
    Add your Function arguments as normal.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  9. #9
    Registered User
    Join Date
    09-06-2011
    Location
    The World
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Adding help text to a user-defined function

    Quote Originally Posted by dominicb View Post
    Good afternoon MalcolmK

    ...and welconme to the forum!

    A word of advice, in future if you're going to ask questions, you have more chance of a reply if you start a thread of your own for the question, rather than tack it on to the end of someone elses.

    To answer your question, why not use code to do it? Go to the VBE and press Ctrl + g to open the immediate window and type in :
    Please Login or Register  to view this content.
    When you save the workbook, this information will be saved with your UDF.

    HTH

    DominicB
    This is really handy! Thanks!

    Is there a similar way to add a description for each individual parameter in the function?

  10. #10
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Adding help text to a user-defined function

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Remember what the dormouse said
    Feed your head

  11. #11
    Registered User
    Join Date
    09-06-2011
    Location
    The World
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Adding help text to a user-defined function

    Quote Originally Posted by romperstomper View Post
    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread.
    Sorry. Please delete my post then, as I cannot seem to find a way to do so myself.

  12. #12
    Registered User
    Join Date
    06-15-2007
    Posts
    9

    Re: Adding help text to a user-defined function

    How annoying, that last question was exactly what I came to this thread to find...

  13. #13
    Registered User
    Join Date
    02-26-2021
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    2

    Re: Adding help text to a user-defined function

    15 years too late, but this thread is still high in the list for search term 'excel vba function parameters help text', so somebody might find this useful.

    dominicb's solution with the works for the general description, but as far as I could figure out, not for the help text for each parameter.

    This is because the help text for the parameters must be given as an array of strings, one for array item for each parameter, and I couldn't see any way to do that in the immediate window.

    So I saved the following Sub in 'Modules':

    Please Login or Register  to view this content.
    F5 or the green arrow button to run, and your help text should now be visible in your function arguments input box

    **EDIT**
    ...and 25 minutes later I discover how to enter an array in the immediate window:

    Please Login or Register  to view this content.
    Last edited by camaraneo; 02-26-2021 at 12:40 PM. Reason: Additional Info

  14. #14
    Registered User
    Join Date
    03-24-2021
    Location
    Paris
    MS-Off Ver
    2016
    Posts
    1

    Re: Adding help text to a user-defined function

    [QUOTE=camaraneo;5479295]15 years too late, but this thread is still high in the list for search term 'excel vba function parameters help text', so somebody might find this useful.

    Indeed after 15 years this subject is not yet dead !
    Thank you for your answer it helps me.

    I would have a follow up question :
    "Is there a way to show the ArgumentDescriptions while the user is typing a custom function ? Without having to open the fx box.

    For excel buildin fuctions the description of each arguments does appear when you start typing the fuction arguments."

  15. #15
    Registered User
    Join Date
    02-26-2021
    Location
    Scotland
    MS-Off Ver
    365
    Posts
    2

    Re: Adding help text to a user-defined function

    Is there a way to show the ArgumentDescriptions while the user is typing a custom function ? Without having to open the fx box.

    For excel buildin fuctions the description of each arguments does appear when you start typing the fuction arguments.
    I looked into this at the time I was trying to figure out the above. Ultimately, the effort required to make it work was greater than I was prepared to put into it, with third-party tools needing installed etc.

    I can't link because I'm new to the forum, but there's a stackoverflow thread that has good info. Try "How to put a tooltip on a user-defined function" in your preferred search engine and the thread should appear.

    EDIT: also try searching for "github excel-dna intellisense"
    Last edited by camaraneo; 03-26-2021 at 08:44 AM. Reason: Additional Info

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Adding help text to a user-defined function

    [QUOTE=sthoAL;5492690]
    Quote Originally Posted by camaraneo View Post
    15 years too late, but this thread is still high in the list for search term 'excel vba function parameters help text', so somebody might find this useful.

    Indeed after 15 years this subject is not yet dead !
    Thank you for your answer it helps me.

    I would have a follow up question :
    "Is there a way to show the ArgumentDescriptions while the user is typing a custom function ? Without having to open the fx box.

    For excel buildin fuctions the description of each arguments does appear when you start typing the fuction arguments."
    Administrative Note:

    Welcome to the forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1