Acelerar búsqueda con excel VBA
Para Dante
Hola buenas tardes Dante, tengo un formulario que realizo la búsqueda por un textbox y listbox, pero le comento que tengo 20 mil registros con 8 columnas, y cuando realizo la búsqueda tarda 12 a 15 segundos en buscar.
Hay alguna manera de mejorar la velocidad de búsqueda o es que excel tiene sus limitaciones en la cantidad de registros y se hace pesado?
Mi equipo tiene buena capacidad y mi archivo tiene apenas 1.35 MB
Este es mi macro
Private Sub Txtbuscar_Change()
Txtbuscar.Text = UCase(Txtbuscar.Text)
Set h5 = Sheets("BIBLIOTECA")
ListBox1.Clear
For i = 8 To h5.Range("A" & Rows.Count).End(xlUp).Row
cad = h5.Cells(i, "B") & UCase(h5.Cells(i, "B")) & h5.Cells(i, "C") & UCase(h5.Cells(i, "C")) & h5.Cells(i, "D") & UCase(h5.Cells(i, "D")) '& h5.Cells(i, "I") & UCase(h5.Cells(i, "I"))
If cad Like "*" & UCase(Txtbuscar) & "*" Then
With ListBox1
. AddItem h5.Cells(i, "A")
. List(.ListCount - 1, 1) = h5.Cells(i, "B")
. List(.ListCount - 1, 2) = h5.Cells(i, "C")
. List(.ListCount - 1, 3) = h5.Cells(i, "D")
. List(.ListCount - 1, 4) = h5.Cells(i, "H")
End With
End If
Next
End SubTe envié el archivo
1 respuesta
Respuesta de Dante Amor
2