Esta es la macro
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
For c = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(c) = True Then
UserForm1.TextBox4 = Me.ListBox1.List(c, 1)
UserForm1.TextBox5 = Me.ListBox1.List(c, 2)
UserForm1.TextBox6 = Me.ListBox1.List(c, 0)
End If
Next
Me.Hide
End Sub
Private Sub TextBox1_Change()
'Act.Por.Dante Amor
If Me.TextBox1 = "" Then
cargalist
Else
For X = 0 To Me.ListBox1.ListCount - 1
NombreMP = Me.ListBox1.List(0, 0)
NombreMP1 = Me.ListBox1.List(0, 1)
NombreMP2 = Me.ListBox1.List(0, 2)
If LCase(NombreMP) Like CStr("*" & LCase(Me.TextBox1.Text) & "*") Then
Me.ListBox1.AddItem NombreMP, Me.ListBox1.ListCount
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = NombreMP1
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = NombreMP2
End If
Me.ListBox1.RemoveItem (0)
Next
End If
End Sub
Private Sub UserForm_Activate()
'act.Por.Dante Amor
cargalist
Me.TextBox1.SetFocus
Me.TextBox1 = ""
End Sub
'
Sub cargalist()
'Por.Dante Amor
ListBox1.Clear
Set l2 = Workbooks("LINEAS DE PRODUCCION.XLS")
Set h2 = l2.Sheets("Listas Lineas")
u = h2.Range("B" & Rows.Count).End(xlUp).Row
For i = 3 To u
Me.ListBox1.AddItem h2.Cells(i, "E")
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = h2.Cells(i, "B")
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = h2.Cells(i, "C")
Next
End Sub