+ Reply to Thread
Results 1 to 3 of 3

Two comboBoxes dependent on one another (userform)

  1. #1
    Registered User
    Join Date
    04-29-2013
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2007
    Posts
    2

    Two comboBoxes dependent on one another (userform)

    Hi, I have two comboboxes, I am able to update the second combobox dependent on the value of the first with the code below. But if I use the same code for the second combobox the userform crashes. Any ideas on how I could get the first to update the second and vice versa?

    Please Login or Register  to view this content.


    Edit: The above code is wrong I just realised, I will keep working on it but if anyone has any input I'd be grateful.
    Last edited by fionamb83; 05-17-2013 at 07:29 AM. Reason: Mistake in code

  2. #2
    Forum Contributor
    Join Date
    07-27-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    198

    Re: Two comboBoxes dependent on one another (userform)

    What you want to do is set up a global flag (a boolean variable) so that when
    you are making a change to one of the 2 combo boxes, the global flag will cause
    the combo's change event code to execute fully only once during the current operation.

    In a new modle insert
    Please Login or Register  to view this content.
    Here is the form code I tested. It has 2 combos and a command button: ComboBox1, ComboBox2, cmdDone
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-29-2013
    Location
    https://t.me/pump_upp
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Two comboBoxes dependent on one another (userform)

    This is a massive help thank you. I don't think I would have thought of this at all.

+ 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