combobox list

bam12

Well-known Member
Joined
Dec 6, 2004
Messages
983
I have a user form with a combobox with a list of about 20 items. When I run the macro it it always has an item hilighted in about the center of the list.

Is there code i can put in to keep the hilight bar always at the top of the list

thanks for any help
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
bam12,
bam12 said:
When I run the macro it it always has an item hilighted in about the center of the list.
seems to me you've some code which is doing this
what's the code you're currently using ?
would this help ?
Code:
Private Sub UserForm_Initialize()
ComboBox1.Value = ComboBox1.List(0)
End Sub

kind regards,
Erik
 

bam12

Well-known Member
Joined
Dec 6, 2004
Messages
983
code fro combobox

this is the code i have for the combobox

Private Sub combobox1_Click()
Range("h26") = ComboBox1
End Sub
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
that's the code used when you click it, whic doens't have any influence on the selection
do you have code like I posted ? (Initialize)
please try also the code provided
 

bam12

Well-known Member
Joined
Dec 6, 2004
Messages
983
thanks

Thanks Erik

that work

appreciate the help

Have nice holiday season
 

Watch MrExcel Video

Forum statistics

Threads
1,118,819
Messages
5,574,503
Members
412,599
Latest member
Schu94
Top