PDA

Click to See Complete Forum and Search --> : Refresh ComboBox after changing ListFill Range


c.p.morris
Dec 4th, 2003, 10:19 AM
It sounds a basic question but I'm struggling to sort it (I only started learning this last year) !

I have a ComboBox on an Excel spreadsheet and three OptionButtons. Selecting an OptionButton changes the ListFillRange of the ComboBox. But the text in the ComboBox does not change until it is clicked and a selection made from the new list of items.

But I want the ComboBox to display the first item in the newly selected list relating to the OptionButton selected.

My code is;

Private Sub optCHS_Click()
ComboBox1.ListFillRange = "CHS"
End Sub

Private Sub optSHS_Click()
ComboBox1.ListFillRange = "SHS"
End Sub

Private Sub optRHS_Click()
ComboBox1.ListFillRange = "RHS"
End Sub

The ListFillRange refers to a block of named cells eg. =Sheet1!$A$11:$A$13

Can anyone help please?

BrianB
Dec 10th, 2003, 09:33 AM
ComboBox1.ListIndex = 0

c.p.morris
Dec 12th, 2003, 06:06 AM
So simple and I've spent hours trying to sort it !

Thanks BrianB !

Regards

c.p.morris