Consulting

Results 1 to 4 of 4

Thread: "Insert Function" Dialog Box Control

  1. #1

    "Insert Function" Dialog Box Control

    Below I have some quick code to open the Insert Function Dialog Box. But I would also like to programatically have it select the proper category and function. This I don't know how to do. What I have below is an example of what I would like to select. I just want to select the items. I do not want the code to 'press ok' so to speak but just select.

    [VBA]Sub OpenFunctionList()

    'Opens "Insert Function" Dialog box
    Application.CommandBars(1).Controls("Insert").Controls("Function...").Execu te

    'Select a Category ???
    'code here to select "database"

    'Select a function ???
    'code here to select "dget"

    End Sub[/VBA]

    Thanks.

  2. #2
    Mac Moderator VBAX Guru mikerickson's Avatar
    Joined
    May 2007
    Location
    Davis CA
    Posts
    2,778
    Another way to call the box is
    Application.Dialogs(xlDialogFunctionWizard).Show
    the Help system says that it has no arguments, but I'm not so sure.
    Application.Dialogs(xlDialogFunctionWizard).Show 1
    results in a differnent appearance. But my fiddling hasn't come up with anything useful (yet).

    I'm wondering, if you know the category and the function that you want to insert, why use the box?

  3. #3
    VBAX Master
    Joined
    Jun 2007
    Location
    East Sussex
    Posts
    1,110
    Location
    If you know the function, then populate the activecell with a dummy version of the formula and then invoke the dialog - it should go to the formula chosen.
    Regards,
    Rory

    Microsoft MVP - Excel

  4. #4
    I have a user toolbar built via an add-in. I have user defined functions that I share with others. The function dialog is for the user to help them understand the UDFs available so that they can use them in more complex equations.

    Some of the functions are run directly from the toolbar and asks the user for input. But there are a handful that I do not want to do that for.

Posting Permissions

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