+ Reply to Thread
Results 1 to 9 of 9

Displaying more than one column in a userform combobox

  1. #1
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    Displaying more than one column in a userform combobox

    Hello -

    I have a combobox on a userform that I have set the columncount to 3, so it displays data from columns A, B, and C when the combobox dropdown is used. However, once someone makes a selection from the dropdown, only the item from the first column is displayed in the combobox. Is there a way for me to show the info from all 3 columns once a selection is made?

    Thank you for the help!
    Last edited by penny; 12-14-2009 at 03:32 PM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Displaying more than one column in a userform combobox

    Use a Listbox control. It will show all three columns. Be sure to set the Bound Column to whichever of the three is correct for your needs.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    Re: Displaying more than one column in a userform combobox

    I wanted to use the drop-down feature of the combobox, which is why I chose that over a listbox. If it's not possible with a combobox, they'll just have to live with it!

  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

    Re: Displaying more than one column in a userform combobox

    Hello Penny,

    Set the ColumnCount property to 3, You can adjust the width of the columns by using the ColumnWidths property.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    Re: Displaying more than one column in a userform combobox

    Quote Originally Posted by Leith Ross View Post
    Hello Penny,

    Set the ColumnCount property to 3, You can adjust the width of the columns by using the ColumnWidths property.
    Hi Leith -

    I do have that property set to 3. I've attached an example of my combobox, maybe this will help to explain what I'm doing.

    Thanks!
    Attached Images Attached Images

  6. #6
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Displaying more than one column in a userform combobox

    It sounds like manipulating the .BoundColumn and .TextColumn properties of the ComboBox might work for you.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Displaying more than one column in a userform combobox

    Why not use 3 comboboxes & set 2 & 3 listindexes to match combobox1's using the change event? Hide the drop downs in 2 & 3
    Attached Files Attached Files
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  8. #8
    Registered User
    Join Date
    03-26-2007
    Posts
    92

    Re: Displaying more than one column in a userform combobox

    Quote Originally Posted by royUK View Post
    Why not use 3 comboboxes & set 2 & 3 listindexes to match combobox1's using the change event? Hide the drop downs in 2 & 3
    Thank you for the suggestion! Sometimes, when you stare at something so long, you forget about alternatives like this. How can I prevent someone from typing in the 2nd and 3rd combo boxes?

  9. #9
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Displaying more than one column in a userform combobox

    Set the Enabled property to False

+ 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