Help! Highlighting text in combo box

sagain2k

Board Regular
Joined
Sep 8, 2002
Messages
94
I created a Combo Box with a drop-down list that works fine at this point, but I would like the text in the box to appear highlighted, so that the user can just start typing to replace that value if desired.

As it is now, the first entry appears non-highlighted, and you have to double-click it to highlight it. You can press the Down Arrow to scroll through the choices, and then either press Enter, Tab, or Down Arrow to go to the next field in the form.

The initialization code for the form is below. What code will cause the text to be highlighted? Thanks!!

--Ray

Private Sub UserForm_Initialize()

CboxCategory.AddItem "CCCA"
CboxCategory.AddItem "Architect"
CboxCategory.AddItem "Contractor"
CboxCategory.SetFocus
CboxCategory.ListIndex = 0

End Sub
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I tried changing the Style as you suggested...still have the same result: it shows the first entry in the list but not highlighted. I can live with having to double-click it first, but it would be nice to have it already highlighted when the form first comes up. Thanks for the response!
 
Upvote 0
It worked for me.

With Style fmStyleDropDownCombo it is white with an insertion character at the end. With Style fmStyleDropDownList it is highlighted blue.
 
Upvote 0

Forum statistics

Threads
1,214,566
Messages
6,120,266
Members
448,953
Latest member
Dutchie_1

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