+ Reply to Thread
Results 1 to 3 of 3

How to make a form ComboBox populate with options from a drop-down list in a cell

  1. #1
    Forum Contributor
    Join Date
    05-19-2012
    Location
    houston
    MS-Off Ver
    excel 2013
    Posts
    103

    How to make a form ComboBox populate with options from a drop-down list in a cell

    Hi,

    Not sure if this is possible... I have a row of student data that I can manually input information into each cell. I also created a form where I can select each student's name and it then populates form text boxes with the info so I can change info on the form too. One of the cells in a column is a drop-down list where I can select from a number of teacher names. When I open the form the current selected teacher's name in the cell populates in the ComboBox2 ok. What I'm trying to do is also have the ComboBox2 populate with the other names in the drop-down list so I can switch names within the form also.

    Here is the current part of the code I'm trying to change so the ComboBox2 populates with all of the options in the drop-down list. Any help would be greatly appreciated.

    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2404
    Posts
    24,757

    Re: How to make a form ComboBox populate with options from a drop-down list in a cell

    I would edit the RowSource property of ComboBox2 to be the same range that you use to define the data validation list for the dropdown in the cell. Then you don't need any change to code.

    On another note, I would recommend against putting GoTo targets in the middle of the code. This can make execution a bit tricky to trace and lead to "spaghetti code." I would suggest this alternative. Also, what error are you anticipating could happen? I notice that you don't do any special handling if an error occurs.
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Contributor
    Join Date
    05-19-2012
    Location
    houston
    MS-Off Ver
    excel 2013
    Posts
    103

    Re: How to make a form ComboBox populate with options from a drop-down list in a cell

    Thanks! Worked great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 12-21-2019, 01:21 AM
  2. Replies: 2
    Last Post: 05-02-2016, 11:31 AM
  3. How do I make a drop down list pre populate another cel?
    By janeo2202 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-02-2015, 01:18 AM
  4. Userform Combobox to populate form: Can I change the order of the columns in the combobox?
    By CraigWiggins in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2014, 12:14 PM
  5. [SOLVED] Make combobox list options dependant on selection in another combobox within a userform
    By Vladimir_Dobvchenko in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-23-2013, 05:30 AM
  6. selecting options on drop down list on web form
    By Shane of the Newbs in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2011, 08:18 AM
  7. transferring combobox value from one user form to populate combobox on another
    By smartphreak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2010, 10:12 PM

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