combobox shows blank until selection made

hitch_hiker

Active Member
Joined
Feb 21, 2012
Messages
294
I have ( with much input and help from here ) a dual column combo box in a userform, which when it starts up, shows as an empty box, when I click on the arrow button, the anticipated list becomes visible and I can select from there. What I want, is when I open the userform I can see the first (n) rows ( depending how long I make the combo box ) and then click the arrow button to continue the list. this way the combo box becomes self explanatory. Is this possible? or am I expecting too much

the code I'm using is:
Rich (BB code):
Rich (BB code):

Private Sub UserForm_Initialize()
Dim cPart As Range
Dim ws As Worksheet
Set ws = Worksheets("product list")
            '  syntax modification suggested mrexcel.com Andrew Poulsom
    Set cPart = ws.Range("U9:V" & ws.Range("U" & Rows.Count).End(xlUp).Row)
  Me.cboPart.List = cPart.Value
            ' range error suggested mrexcel.com Norie
Me.cboPart.SetFocus
   
        Rem http://www.contextures.com/xlUserForm02.html
End Sub

 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Maybe something like:

Code:
Private Sub UserForm_Initialize()

With Sheets("product list")
    Me.cboPart.List = .Range("U9:V" & .Range("U" & .Rows.Count).End(xlUp).Row).Value
End With

Me.cboPart.DropDown

End Sub
 
Upvote 0
Thanks Kyle,

almost worked , Your solution gives a dropdown list correctly populated in one section of the screen and the userform with the combo box in another. when I select from your list the selection goes into the combo box and everything works from there . if only I could combine your correectly populated list into my combo box. definately something to play with now
 
Upvote 0
Ok, try this

Code:
Private Sub UserForm_Activate()
Me.cbopart.DropDown
End Sub

Private Sub UserForm_Initialize()

With Sheets("product list")
    Me.cbopart.List = .Range("U9:V" & .Range("U" & .Rows.Count).End(xlUp).Row).Value
End With

End Sub
 
Upvote 0
many thanks Kyle,
that's almost done the trick, certainly workable , the input box of the combo box is still white but the list is directly below it, and works nicely
I tried to paste a pic, but I can't for some reason
 
Upvote 0
What are you wanting in the input-box? IT would already be filled in then?
 
Upvote 0
good call, I had a picture in my mind and it didn't match, but i take your point, and as I said a lot better than where I was, and looks better than the first attempt, so with many thanks , I will change the size of the combo box and it will better match my original plan
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,541
Members
449,089
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top