Filtrar los datos del combobox mientras escribes y desplegar las coincidencias:
Código:
__________
Option Explicit
Dim a As Variant, b As Variant
Private Sub ComboBox1_Change()
Dim precio As Double
With ComboBox1
.List = Filter(Application.Transpose(a), .Text, True, vbTextCompare)
.DropDown
TextBox1.Value = ""
If .ListIndex > -1 Then
precio = Sheets("Hoja1").Range("A:A").Find(.Value, , xlValues, xlWhole).Offset(, 1)
TextBox1.Value = Format(precio, "$ #,###.##")
End If
End With
End Sub
Private Sub UserForm_Activate()
a = Sheets("Hoja1").Range("A2", Sheets("Hoja1").Range("A" & Rows.Count).End(3)).Value
ComboBox1.List = a
End Sub
__________
No hay comentarios.:
Publicar un comentario