问题
I have a userform
that contains a combobox
where I can search through.
If I recall this userform
directly, the combobox
works fine.
If I instead start from another userform
and press a button to open the userform
with my combobox
, the search won't work.
I tried with "_Change".
This is the applicable part of the first userform:
If InStr(I1.Text, " ") > 0 Then
New_Pat.First.Text = Left(I1.Text, Len(I1.Text) - 1 - (Len(I1.Text) - InStr(I1.Text, " ")))
New_Pat.Second.Text = Right(I1.Text, Len(I1.Text) - Len(Left(I1.Text, Len(I1.Text) - (Len(I1.Text) - InStr(I1.Text, " ")))))
New_Pat.Combobox10.SetFocus
Else
New_Pat.First.Text = I1.Text
New_Pat.Combobox10.SetFocus
End If
New_Pat.Show
And this is the part of New_Pat
Private Sub ComboBox10_Change() 'Keydown(ByVal keycode As MSforms.ReturnInteger, ByVal shift As Integer) 'Click() 'AfterUpdate() 'Change()
Sheets("ListOfName").Select
ComboBox1.Value = Cells(ComboBox10.ListIndex + 2, 91)
End Sub
来源:https://stackoverflow.com/questions/59582575/process-a-combobox-called-from-another-userform