+ Reply to Thread
Results 1 to 4 of 4

Include suggestions for arguments in VBA Function

  1. #1
    Registered User
    Join Date
    07-05-2016
    Location
    Oakland, California
    MS-Off Ver
    2013
    Posts
    5

    Include suggestions for arguments in VBA Function

    Hi All,

    When using existing functions within Excel, suggestions pop up when you begin typing within the function for what each argument should be (e.g. when using Sum, it says SUM([number1],[number2],.....). Is there some way to make new functions written in VBA also give these types of suggestions? I'm writing this: Function SumFirst(pname As String, firstxcol As Integer, rng As Range) As Single and would like suggestions to pop up for input when calling the function directly in a sheet.

    Thanks

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Include suggestions for arguments in VBA Function

    I don't think this is possible in VBA w/o using C# or something, though even that seems of limited success.

    Take a look at this post where I recommended an alternative. Maybe that will be sufficient for you?

    http://www.excelforum.com/excel-programming-vba-macros/1125880-excel-function-tooltip.html

    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Forum Expert GeneralDisarray's Avatar
    Join Date
    09-15-2011
    Location
    Pittsburgh, PA, USA
    MS-Off Ver
    Windows Excel 2016
    Posts
    1,416

    Re: Include suggestions for arguments in VBA Function

    I don't know how make the suggestions pop up like a native function, BUT I do have a neat trick to give you the variable names (so you at least don't have to remember them).

    Type the function, all the way to the first "(" then press cntrl+shift+A -- that will fill in the variables (which you can then over-write)


    So:

    Type: =SumFirst( then press cntrl+Shift+A and you will get this: =SumFirst(pname, firstxcol, rng) You can then replace the variable names with what you need :D
    Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.

  4. #4
    Registered User
    Join Date
    07-05-2016
    Location
    Oakland, California
    MS-Off Ver
    2013
    Posts
    5

    Re: Include suggestions for arguments in VBA Function

    These two answers are perfect, that control+shift+A trick is pretty much it. I'm the only person who will really use the function so that does the job perfectly. Thanks for the help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Please scrutinize this simple working function and give your suggestions
    By onmyway in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2015, 01:00 PM
  2. [SOLVED] Too Many Arguments for This Function.
    By sander07 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-22-2013, 07:34 PM
  3. Search function with suggestions (little bit like google)
    By joshnathan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2013, 10:15 AM
  4. IF Function - Too Many Arguments
    By svconners in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 07-05-2013, 05:06 PM
  5. two different arguments in one IF function?
    By VAZIM in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-16-2013, 08:48 AM
  6. Replies: 0
    Last Post: 06-20-2006, 10:55 AM
  7. Suggestions:Function help!
    By JN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-20-2005, 12:05 PM

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