直接这样写就行了。
Dim i As Long
If List1.ListCount > 0 Then
For i = 0 To List1.ListCount - 1
If Text1.Text = Left(List1.List(i), Len(Text1.Text)) Then
List1.ListIndex = i
Exit For
End If
Next
End If
foreach( in ){ }