Highlight text in a combo box?

razzandy

Active Member
Joined
Jun 26, 2002
Messages
390
Office Version
  1. 2007
Platform
  1. Windows
Can the text be highlighted in a combo box? You know like when you make a selection from the combo box list the text is highlighted blue. I want the text already selected when the combo box is loaded up. I need something like the below code:

Combobox1.Selected(Combobox1.Listcount)

Thanks in advance

Ryan A UK
:biggrin:
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

KenCriss

Active Member
Joined
Jun 6, 2005
Messages
326
Don't know if this would apply to a combobox, but this has worked for me in a textbox.
Code:
Private Sub UserForm_Activate()
TextBox1.Text = ActiveWorkbook.Path & "\" & ActiveWorkbook.Name
TextBox1.SelStart = 0
TextBox1.SelLength = Len(TextBox1.Text)
End Sub
 
Upvote 0

razzandy

Active Member
Joined
Jun 26, 2002
Messages
390
Office Version
  1. 2007
Platform
  1. Windows
Thanks for that. That’s some useful code I didn’t know about!

Cheers


Ryan A UK
:biggrin:
 
Upvote 0

Forum statistics

Threads
1,196,010
Messages
6,012,843
Members
441,733
Latest member
MartijnB

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
Top