I have a Userform with a single ComboBox control that displays when a certain cell is clicked. Everything works fine except I want the first value in the list to be displayed in the box (as opposed to blank). If I try setting the Value or Text or ListIndex before Show I get a run-time error. What am I doing wrong?
Code:Private Sub TestComboBox() Const strList As String = "one,two,three,four,five,six,other" With UserForm1 .Caption = "Choose Item from List" .ComboBox1.List = Split(strList, ",") ' .ComboBox1.ListIndex = 0 'Run-time error. Automation error. The callee ... is not available... .Show vbModeless End With End Sub





Reply With Quote