Private Sub TextBox1_Change()
On Error Resume Next
Set b = Sheets("BaseDatos")
uf = b.Range("b" & Rows.Count).End(xlUp).Row ' seleccina fila
'wc = Mid(uc, InStr(uc, "$") + 1, InStr(2, uc, "$") - 2)
If Trim(TextBox1.Value) = "" Then
'Me.ListBox1.List() = b.Range("b3:H" & uf).Value
Me.ListBox1.RowSource = "BaseDatos!b3:R" & uf 'cambio de columna
Exit Sub
End If
b.AutoFilterMode = False
Me.ListBox1 = Clear
Me.ListBox1.RowSource = Clear
For i = 2 To uf
strg = b.Cells(i, 5).Value
If UCase(strg) Like UCase(TextBox1.Value) & "*" Then
Me.ListBox1.AddItem b.Cells(i, 2)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = b.Cells(i, 3)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Format(b.Cells(i, 4), "hh:mm")
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = b.Cells(i, 5)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = b.Cells(i, 6)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 5) = b.Cells(i, 7)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 6) = b.Cells(i, 8)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 7) = Format(b.Cells(i, 9), "hh:mm")
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 8) = b.Cells(i, 10)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 9) = b.Cells(i, 11)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 10) = b.Cells(i, 12)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 11) = b.Cells(i, 13)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 12) = b.Cells(i, 14)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 13) = b.Cells(i, 15)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 14) = b.Cells(i, 16)
End If
Next i
Me.ListBox1.ColumnWidths = "30 pt;50 pt;41 pt;110 pt;110 pt;45 pt;50 pt;30 pt;60 pt;110 pt;20 pt;60 pt;35 pt;35 pt;35 pt;60 pt;110 pt"
End Sub