+ Reply to Thread
Results 1 to 6 of 6

Assigning Macro to VBA added DropDown boxes

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Assigning Macro to VBA added DropDown boxes

    Hello,

    First off, thank you for taking the time to read and hopefully answer this post.

    I have a macro that creates dropdown boxes (amongst other things) iteratively via a spinner button. I wish for these dropdown boxes to call upon another macro (ReservesMovement) that uses a Case value to decided how to format the criteria, based on the value of the added Dropdown box.

    I am having trouble finding a way to assign the Reserves Movement macro to the newly added dropdown boxes. Ultimately I will want the macro to recognize which dropdown box I am changing and just reformat the cells that I've assigned to that dropdown box.

    Many thanks in advance for your help.

    Matt
    Last edited by gruberm; 01-03-2013 at 07:27 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Assigning Macro to VBA added DropDown boxes

    Matt

    What type of dropdowns are you adding?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Assigning Macro to VBA added DropDown boxes

    Post a small sample of what you now have.
    Gary's Student

  4. #4
    Registered User
    Join Date
    11-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Assigning Macro to VBA added DropDown boxes

    They are Combobox form controls added via VBA.

    Below is the code where I've added the dropdowns but I haven't had an issue with that. I would now like to assign these drop downs to a seperate macro, just as one would do via a right click on the mouse, manually.

    Please Login or Register  to view this content.
    Thanks!
    Last edited by gruberm; 01-03-2013 at 05:24 AM. Reason: missed one line of code

  5. #5
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Assigning Macro to VBA added DropDown boxes

    Matt

    You can use the OnAction property to assign a macro to a Forms control.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-05-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Assigning Macro to VBA added DropDown boxes

    that was the trick I needed. Thank you Norie!

+ 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