Form busqueda en excel para modificar y eliminar registros

Estoy bloqueado con el form de búsqueda para eliminar y modificar registros.

Tengo mi form_articulos del cual puedo ir a un form_articulos_buscar.

Aquí llega mi problema. Quiero escribir en un textbox algún trozo del nombre, y me filtre en un listbox todos los arcticulos que contengan eso que he escrito.

Señalar en el listbox el articulo que quiera. Y con dos botones o que se abra un form para modificar o eliminar el registro directamente.

1 respuesta

Respuesta
1

Envíame tu archivo con userform y me explicas con un ejemplo qué quieres buscar, en dónde quieres buscar y qué datos quieres cargar en el listbox

Mi correo [email protected]

En el asunto del correo escribe tu nombre de usuario “fjpg81” y el título de esta pregunta.

¡Gracias! 

Acabo de mandarle el archivo al correo que me facilito.

MUCHAS GRACIAS!!!!

Te anexo la parte para cargar el listbox, seleccionar un registro del listbox y abrir el form para modificar.

Dim h1
'
Private Sub cmb_buscar_Click()
'Por.Dante Amor
    listbox1.Clear
    If txt_buscar.Value = "" Then
        MsgBox "Escribe un dato a buscar"
        Exit Sub
    End If
    Set r = h1.Columns("B")
    Set b = r.Find(txt_buscar, LookAt:=xlPart)
    If Not b Is Nothing Then
        celda = b.Address
        Do
            'detalle
            Listbox1. AddItem h1. Cells(b.Row, "A")
            Listbox1. List(listbox1.ListCount - 1, 1) = h1. Cells(b.Row, "B")
            Listbox1. List(listbox1.ListCount - 1, 2) = h1. Cells(b.Row, "C")
            Listbox1. List(listbox1.ListCount - 1, 3) = h1. Cells(b.Row, "D")
            listbox1.List(listbox1.ListCount - 1, 4) = b.Row
            Set b = r.FindNext(b)
        Loop While Not b Is Nothing And b.Address <> celda
    End If
End Sub
Private Sub cmb_modificar_Click()
'Por.Dante Amor
    If listbox1.ListIndex = -1 Then
        MsgBox "Selecciona un registro a modificar"
        Exit Sub
    End If
    frm_articulos_modificar.Show
End Sub
'
Private Sub UserForm_Activate()
    Set h1 = Sheets("ARTICULOS")
End Sub

sal u dos

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas