+ Reply to Thread
Results 1 to 7 of 7

Add additional columns to user form combo box

  1. #1
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Add additional columns to user form combo box

    I have the following code that populates a combo box with data from the 6th column within the workbook Log File.

    I'm attampting to add one if not more additional columns to this combo box, specifiaclly i wanted to show column 2 . I changing the column count in the combo box propeties and changed the column width string below to account for the additional columns and it displays fine, a product type and part number, however when i select the part number i want from column 6, the combo box shows the corresponding value from column 2. The data does load correctly to the user form, it just looks strange when the combo box shows the column 2 value, does anyone have an idea how i can show the value from column 6 when selection is made?

    Thanks


    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

    Re: Add additional columns to user form combo box

    Change the bound column of the combobox to show a specific column.

    By the way, why is the range you are populating the combobox with 74 columns wide?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Add additional columns to user form combo box

    Norie,

    I tried your suggestion and it still shows the second column after making the selection.

    In reference to the 74 columns wide range, I'm selecting the entire database range, then on the part number column via the combo box, i'm selecting the record of interest to load into my user form. You probably are thinking it's comsuming a lot of computer resources to do this.

    If i were to only populate the combo box with columns 2 and 6 from the database, then select the appropriate part number via the combo box, then go grab the remainder of the information from the corresponding row would likely take much less computer resources. Any thoughts on how to do this.

    Thanks

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Add additional columns to user form combo box

    What exactly did you try?

    As for loading all the data into the combobox, that's not an approach I use a lot so I'm not sure if there is any impact on resources.

    Have you noticed anything? For example a bit of a lag when you open the form.

  5. #5
    Forum Contributor
    Join Date
    12-22-2012
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    205

    Re: Add additional columns to user form combo box

    Norie,

    I tried the bound column to 2 in the combo box properties.

    For the second question, i really don't notice much of a delay/lag in loading the user form.

    Thanks

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Add additional columns to user form combo box

    I thought you wanted column 6 displayed not column 2?

    You should set the bound column to the column you want displayed.

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Add additional columns to user form combo box

    Actually it's TextColumn you need to use to set which column is displayed.

+ 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. User form combo box
    By slickz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-24-2014, 09:02 AM
  2. combo box user form code for two combo boxes
    By robert.begley1 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-01-2012, 02:25 PM
  3. combo box user form
    By robert.begley1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-28-2012, 03:38 PM
  4. [SOLVED] combo box in a user form
    By juliejg1 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-10-2006, 04:20 PM
  5. Can't seem to get Combo Box on User Form
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-25-2005, 07:06 AM

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