Private Sub ComboBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Call Combobox1_Populate
End Sub
Private Sub UserForm_Initialize()
Call Combobox1_Populate
End Sub
Sub Combobox1_Populate()
Dim arrIn As Variant, arrOut As Variant
Dim i As Long, j As Long
arrIn = Sheet1.Range("A2:G7")
ReDim arrOut(1 To UBound(arrIn), 1 To 2)
For i = 1 To UBound(arrIn)
If arrIn(i, 1) Like ComboBox1.Text & "*" Then
j = j + 1
arrOut(j, 1) = arrIn(i, 1)
arrOut(j, 2) = arrIn(i, 2)
End If
Next
ComboBox1.List = arrOut
End Sub
Sub Combobox1_Populate(Optional fltr As String)
ComboBox1.List = Filter(Array("qqq", "qqwww", "qqttt", "qwer"), fltr)
End Sub
Private Sub ComboBox1_KeyUp(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Call Combobox1_Populate(ComboBox1.Text)
End Sub
Private Sub UserForm_Initialize()
Call Combobox1_Populate
End Sub
Private Sub CB1_Change()
Dim x As Integer
With CB1
For x = 0 To UBound(ListaAT)
If UCase(.Value) = UCase(ListaAT(x)) And Len(.Value) >= 1 Then
Call AutoTexto.Roda_AutoTexto
Exit Sub
End If
Next x
.Visible = False
Do While .ListCount > 0
.RemoveItem (0)
Loop
For x = 0 To UBound(ListaAT)
If .Value = "" Then
.AddItem ListaAT(x)
Else
If UCase(Left(ListaAT(x), Len(.Value))) = UCase(.Value) Then .AddItem ListaAT(x)
End If
Next x
.Visible = True
.SetFocus
.DropDown
End With
End Sub