+ Reply to Thread
Results 1 to 4 of 4

How to make a two column combobox that uses a range of values

  1. #1
    Registered User
    Join Date
    05-16-2014
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Post How to make a two column combobox that uses a range of values

    Currently, I have some perfectly working functionality that does the following:

    A userform is launched from a command button on one of my worksheets.
    This userform called "Project_Selector", has two comboboxes and a button on it. What it does is when you open the first combobox it presents a static list of values "Active" and "Inactive" (these are hard coded in the code). When you choose one of these values it does a lookup (contained in a loop and Case statement) on a column in one of two worksheets. It looks for and returns all the values in that column and populates the second combobox with them.

    Basically it acts as a two stage filter and allows you to find an entry and then act on it by clicking the button.

    My problem is that the list of values that get populated in the second combobox is a column that only contains project codes, and I would like for it to have two columns, one which has the code and the other that contains the contents of a different column in the worksheet that they are being retreived from, that is more descriptive and can help the use choose.

    Does anyone have any thoughts on how to accomplish this?

    Here is my code:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Have you considered using a multicolumn listbox instead of the second combobox?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    05-16-2014
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How to make a two column combobox that uses a range of values

    I have seen that a listbox could be used, but am not sure how to integrate it into the code above. Sorry, I am fairly new to VBA.

  4. #4
    Registered User
    Join Date
    05-16-2014
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How to make a two column combobox that uses a range of values

    Norie - Thanks, after investigating I got the listbox to work. A much better solution in every way.

+ 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. How to make two column combobox, show two columns after picked value !
    By Petter120 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2012, 05:28 PM
  2. Use a combobox to put values somewhere else from a different range
    By grid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2011, 05:32 AM
  3. Replies: 2
    Last Post: 09-14-2009, 08:34 AM
  4. Multi Column ComboBox-How do I make the combo box show up the value ?
    By Baapi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2007, 12:05 PM
  5. Pasting cell range to make selections from existing combobox listings
    By darmstrong in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-21-2007, 09:48 AM

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