+ Reply to Thread
Results 1 to 6 of 6

Multi Column Combo Box, with Variable data

  1. #1
    Registered User
    Join Date
    12-12-2009
    Location
    York, UK
    MS-Off Ver
    Excel 2007
    Posts
    16

    Question Multi Column Combo Box, with Variable data

    Hi All,

    I'm currently working on an excel vba application for my local scout group with the prospect of making it open source to the scouting community.

    I would like to have a Combo box that will look at a worksheet and populate with a drop down list of Camps the cubs have been on showing a 3 column drop down box.

    Example below:

    Camp Date |Camp Location | Number of Nights
    01/06/2009 | Snowball | 2
    06/07/2009 | Strensall Common | 1
    09/09/2009 | Snowball | 3

    Have seen this done on the net before but cant find the code

    Thanks,
    Dan

  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: Multi Column Combo Box, with Variable data

    Once you have created the combo box, set the ListFillRange property to the sheet and cell references where the 3-column list of camps is contained.

    Optional, but recommended: create a dynamic named range for the list of camps and use this named range as the source for the ListFillRange property.

    Next, set the Column Count property to 3 to show all three columns. You may want to adjust the Column Widths property of the control to size them so all three of the columns clearly show the list items.

    While in the VB Editor and in one of the property boxes, press the F1 key to get help on that property.

    Post a sample workbook if you need more help.
    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
    12-12-2009
    Location
    York, UK
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Multi Column Combo Box, with Variable data

    Hi Palmetto,

    Cant get it to work, see workbook attached.

    I can only get the one column showing.

    Thanks,
    Dan
    Attached Files Attached Files

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

    Re: Multi Column Combo Box, with Variable data

    Your dynamic named range formula is set to only encompass one column.

    Your formula: =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$C),1)

    Use this: =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),3)

  5. #5
    Registered User
    Join Date
    12-12-2009
    Location
    York, UK
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Multi Column Combo Box, with Variable data

    Palmetto,

    Thank you for that bit of help, can I get the result to go into 3 text boxes

    For example, if you select ;

    10/09/2009 Snowball 4
    Then the 3 text boxes on the userform will be populated with this info?

    Thanks & Merry Christmas,
    Dan
    Attached Files Attached Files

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

    Re: Multi Column Combo Box, with Variable data

    I see no reason why you would want to place the list items into textboxes, but here is code, which used the combobox change event.

    Please Login or Register  to view this content.

+ 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