Hi, I have the error: Error 381: could not set list promerty. invalid property array index
could you let me know my mistake in this code:
Private Sub CMDBuscar_Click()
If TXT_Buscar.Text = "" Then
MsgBox ("Por favor ingresar apellidos a buscar"), vbExclamation, "Error de busqueda"
TXT_Buscar.SetFocus
Exit Sub
End If
LST_Buscar.Clear
Xnum = Range("TablaDatos").CurrentRegion.Rows.Count
For i = 3 To Xnum + 2
If LCase(Cells(i, 4).Value) Like "*" & LCase(Me.TXT_Buscar.Text) & "*" Then
LST_Buscar2.AddItem Cells(i, 1)
LST_Buscar2.List(LST_Buscar.ListCount - 1, 1) = Cells(i, 2)
LST_Buscar2.List(LST_Buscar.ListCount - 1, 2) = Cells(i, 3)
LST_Buscar2.List(LST_Buscar.ListCount - 1, 3) = Cells(i, 4)
LST_Buscar2.List(LST_Buscar.ListCount - 1, 4) = Cells(i, 5)
End If
Next i
End Sub
gracias.