+ Reply to Thread
Results 1 to 3 of 3

Dynamically add pop up combo box with a click event

  1. #1
    Registered User
    Join Date
    07-10-2008
    Location
    New York
    Posts
    2

    Dynamically add pop up combo box with a click event

    Hi,

    I'm looking for a little help to do the following. Any info is greatly appreciated.

    I'm trying to write a macro in XL that when run, will first pop up a combo box. The combo box needs to be filled by a range of cell values on the fly. Secondly, once the combo box is visible, I need to fire the click event of this combo box. Lastly, the combo box will be removed.

    So, I need to:
    --Have the user run a macro.
    --Macro adds a combo box dialogue and fills with a range of cells on the active sheet.
    --Once a selection is made in the combo box an event will be fired.
    --Delete the combo box.

    Thanks for the help.

    Cheers,
    Ed

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi, and welcome to the forum.

    I suggest you add a UserForm in the VBE and put a combobox on the form.
    Give a name to the range of cells which contain the values you want to use in populating the combobox. If this range varies in size, then you'd be advised to make it a dynamic rage name.

    In the combobox properties window, put the name of the Excel range above in the RowSource property

    Now again in the VBE add a Module, and within the module a procedure that will Show the UserForm containing the combobox.
    i.e.
    Please Login or Register  to view this content.
    In the Excel sheet add a button to run the macro, right click the button and link it to the ShowForm macro

    In the VBE, put your code in the ComboBox Click or Change event, and make the last line of this event either
    UserForm1.Hide or
    Unload UserForm1


    HTH
    Last edited by Richard Buttrey; 07-11-2008 at 01:31 PM.

  3. #3
    Registered User
    Join Date
    07-10-2008
    Location
    New York
    Posts
    2
    Thanks Richard. This was a big help and worked to boot!

    Cheers,
    Ed

+ 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