MichaelBedano
New Member
- Joined
- Apr 9, 2019
- Messages
- 5
Hi Everyone I have a code that suppose to make the combobox in the userform searchable found this code in the internet but the subscript error out of range occurred. I already changed the worksheet name to the existing worksheet but still there is an error. can anyone please help me resolved the problem below is the code that I used in the combobox.
My list that should be in the drop is in Sheet4 and in column a with multiple rows. Thanks in advance for the help.
My list that should be in the drop is in Sheet4 and in column a with multiple rows. Thanks in advance for the help.
Code:
Private Sub KgArec3_Change() Dim e, temp
With Me
temp = .KgArec3.Value
If Not .KgArec3.MatchFound Then
.KgArec3.Clear
If Len(temp) Then
For Each e In Sheets("sheet4").Cells(1).Offset(1).Value
If (e <> "") * (e Like "*" & temp & "*") Then
.KgArec3.AddItem e
End If
Next
If .KgArec3.ListCount > 0 Then
.KgArec3.ListIndex = 0
End If
End If
End If
End With
End Sub