+ Reply to Thread
Results 1 to 6 of 6

Source Data for Combo Boxes

  1. #1
    Registered User
    Join Date
    11-02-2009
    Location
    Wallingford, CT
    MS-Off Ver
    Excel 2007
    Posts
    5

    Source Data for Combo Boxes

    Hi

    I'm new to the forums

    I'm just picking up VBA now and had a question I'm hoping someone could shed some light on.

    I'm trying to create a workbook for tracking costs and change orders for multiple subcontractors.

    My main question is about combo boxes. I would like to create a master list of subcontractors on The masterlists tab of the attached workbook. I would like to use this masterlist as the data source for a combo box I'm going to use to replace the subcontractor txtbox on the SubCoEntryFrm.

    I figured getting away from a user typing something in would benefit me if I wanted to use that subcontractor name field to analyze data

    Any thoughts? I've attached the workbook to the post.

    Thanks,
    Attached Files Attached Files
    Last edited by Skelly022782; 11-03-2009 at 04:58 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Source Data for Combo Boxes

    Hi Skelly022782
    It depends on how and where your ComboBox is created. I created a Dynamic Named Range called "Subcontractors" and included three different ways to view the ComboBox on your sheet Master Lists. Look behind the properties or format control to see how the Named Range is referenced.
    I also added a ComboBox to your UserForm SubCoEntryFrm. Take a look at these various scenarios. If you have questions, get back to me.
    John
    Attached Files Attached Files
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    11-02-2009
    Location
    Wallingford, CT
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Source Data for Combo Boxes

    Thanks for your reply, I really appreciate it.

    Now I understand how to create a dynamic range. I just had one followup-question. I went into the masterlists tab and added some subcontractors and noticed that the active X combo box you created didn't immediately display the newly added subs while the combo box on the form did.

    When I closed the excel file and re-opened it, the direct x combo box seemed to refresh with the rest of the subs. Is this just the way a direct x combo box behaves in excel?

    Thanks for the help!

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Source Data for Combo Boxes

    Hi Skelly022782
    No, as you enter items into the dynamic range, they should be available immediately to the ComboBox. I think what might be happening is that the examples in my post had only 8 items in the examples and thats all you were seeing after you added additional items. You would need to scroll down to see your added items.
    You can fix this by changing the properties of the ComboBox. It's called "List Rows" in the Activex form and "Drop Down Lines" in the Form Control. Try changing those items to a greater number and see if this doesn't fix the problem. You can make the number anything you want.
    Let me know how you make out. John

  5. #5
    Registered User
    Join Date
    11-02-2009
    Location
    Wallingford, CT
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Source Data for Combo Boxes

    Made out great. Thanks again.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Source Data for Combo Boxes

    You're welcome. If you're satisfied with the solution, please mark your thread solved.
    To mark your thread solved do the following:
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save
    John

+ 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