+ Reply to Thread
Results 1 to 5 of 5

Userform Dependent Lists fails to display when OptionButtons added

  1. #1
    Registered User
    Join Date
    12-25-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2010
    Posts
    8

    Userform Dependent Lists fails to display when OptionButtons added

    Hello,

    I have modified a Parent/Child/Grandchild Dependent Listbox example that was kindly posted by D.Kusleika of Dailydoseofexcel. I have added some option buttons to the Userform, but in so doing, it causes some of the Listboxes to remain blank until the user selects an item of interest. I just cant find a way to consistently populate the three list boxes when the form first opens. Removing the option buttons and everything is fine.

    Secondly, could anyone suggest some code that remembers what option button was selected the last time the Userform was opened ?

    Many thanks

    Richard
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Userform Dependent Lists fails to display when OptionButtons added

    This saves the last OptionButton selected to cell D2 on Sheet1. It then selects from that saved setting the OptionButton when the userform is re-initialized. This seems to cure the blank listboxes as well.

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-25-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Userform Dependent Lists fails to display when OptionButtons added

    Thanks, AlphaFrog. The save for the option button works perfectly. However, the problem with the blank child & grandchildren boxes still exists. It is strange, sometimes those two boxes are populated and at other times, they are not. Eg if you save the file and re-open, the lists do not update until you select a Parent. Frustrating !

    If you like a challenge, then I would be welcome any help !

    thx

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Userform Dependent Lists fails to display when OptionButtons added

    You're welcome.

    I notice if you click the button on Sheet1 to initiate the Userform, all the listboxes populate because the assigned macro to that button does help configure the listboxes. If you just run the UserForm's code from the VBA editor, the listboxes don't populate because the assigned macro isn't run.

    Otherwise, I haven't noticed the blank listboxes.

  5. #5
    Registered User
    Join Date
    12-25-2012
    Location
    Stavanger, Norway
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Userform Dependent Lists fails to display when OptionButtons added

    After I saved the modifications. it worked !

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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