Results 1 to 5 of 5
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ComboBox or Something Else (XP:SP3)

    I am trying to display the contents of a dynamic range in a combobox. The number of rows will never exceed four including the field header. I'm not sure if the combobox is the best approach. Ultimately the four rows will always be displayed such as:

    Member Fingers
    Hans 12
    Legare 10
    Andres 10


    I created the combobox from a control-toolbox and entered the dynamic range into the ListFillRange but can only see the first column "Member" and can not display all four rows.

    Your suggestions are appreciated,
    John

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: ComboBox or Something Else (XP:SP3)

    Control toolbox items do not work with dynamic ranges. If you want to use a dyanamic range you will have use the FORMS items.

    The control toolbox controls seem to read the range when it is created and never check again. Your only other option is to add code to the control to "edit" the listfillrange whenever it is used. Something like (which assumes the combox is named combobox1 and the named range is called "Data") in the worksheet object could work:

    Private Sub ComboBox1_GotFocus()
    ComboBox1.ListFillRange = "Data"
    End Sub

    Did you remember to change the combobox "columnCount" to 2 to see both the columns? Just having a 2 column range is not enough. Also check the columnwidths to ensure that the second is not 0.

    Steve

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox or Something Else (XP:SP3)

    Steve,

    Thanks for the advice. I now see both columns in the combobox. Is it possible to always display the four rows (includes header field)? Currently the combobox shows only one row with the arrow to dropdown. Once the dropdown arrow is selected one can see all rows.

    Perhaps the combobox approach is not the best approach. Basically I'm after some type of "scorecard" posting as depicted in my previous post.

    Regards,
    John

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: ComboBox or Something Else (XP:SP3)

    A combo shows 1 row until you expand it. If you only want to show 4 try a list box, you can set the size to show as many rows as you like

    Steve

  5. #5
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ComboBox or Something Else (XP:SP3)

    Steve,

    It appears that the listbox is the way to go. One strange thing that I notice is when the excel file is saved/closed and then reopened, the listbox shrinks and the verticle/horizontal slide bars appear. Prior to the file being saved, the listbox is stretched out to show all four rows with not slide bars.

    Is there a specific setting that I may have overlooked?

    Regards,
    John

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •