+ Reply to Thread
Results 1 to 8 of 8

Combo Box Choices Won't Propogate

  1. #1
    Registered User
    Join Date
    07-09-2008
    Location
    Panama City, FL
    MS-Off Ver
    2007
    Posts
    42

    Combo Box Choices Won't Propogate

    I have a combo box by the name of cbFamilyOrder, and I want to fill it in with four choices. I thought that the code below was working, but apparently that's not the case, since no options appear. The following code is in the sheet code:

    Please Login or Register  to view this content.
    I have tried going to the Control Options, but there is no Control tab there from which to add information. I am at a complete loss - anyone?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello teddybouch,,

    Here is the proper code for loading a Control Toolbox ComboBox on a worksheet...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    07-09-2008
    Location
    Panama City, FL
    MS-Off Ver
    2007
    Posts
    42
    Hmm...that unfortunately doesn't appear to be working, either. On a whim, I put a debug statement in the Worksheet_Activate function and nothing ever printed into the Immediate window despite doing several things in the worksheet. Why wouldn't this be being called?

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello teddybouch,

    Which version of Office are you using? Is your machine a PC or Mac?

    Sincerely,
    Leith Ross

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello teddybouch,

    It could be your Excel Events have become disabled. Place this code in a Standard VBA module an run it before activating the worksheet to load the ComboBox.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    07-09-2008
    Location
    Panama City, FL
    MS-Off Ver
    2007
    Posts
    42
    Exactly right - I have no idea how that happened, but as soon as I enabled events again, the options were there.

    In case this happens again or when one of the users is doing it, is there a way to ensure that events are enabled when the spreadsheet is loaded?

    Also, I just learned about UserForms, and I'm trying to translate this to that and I'm having a similar problem. Here's my code:

    Please Login or Register  to view this content.
    The debug statement in this one prints, but the list of options doesn't show up in the combo box. Any thoughts? Thank you very much for all your help thus far - this is the fastest and best that I have had a question answered in my time on this forum.

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello teddybouch,

    Try moving the UserForm code to the UserForm_Activate event. The reason is the ComboBox is a child window of the UserForm. All windows are repainted during the UserForm_Activate event. After the data is added to the ComboBox, it must be repainted to display the contents in the drop down portion of the control.

    Sincerely,
    Leith Ross

  8. #8
    Registered User
    Join Date
    07-09-2008
    Location
    Panama City, FL
    MS-Off Ver
    2007
    Posts
    42
    Confirm that works. Thanks, Leith!

+ 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