View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
merjet merjet is offline
external usenet poster
 
Posts: 812
Default preselecting in combo box

Private Sub UserForm_Initialize()
Dim iCt As Integer

iCt = -1
For Each c In Range(ComboBox1.RowSource)
iCt = iCt + 1
If c = Range("B11") Then
ComboBox1.ListIndex = iCt
Exit Sub
End If
Next c

End Sub

The above assumes the RowSource property has been set and the sheet
with the relevant B11 is the ActiveSheet.

Hth,
Merjet