Macro para copiar datos
Hola a todos, alguien me podría ayudar con este macro para que permita consultar 2 criterios (columnas M y N) y no una sola. El destino de la copia seria la misma Hoja2.
Gracias por su repuesta.
Sub buscar()
filalibre = Sheets("hoja2").Range("m150000").End(xlUp).Row + 1
dato = InputBox("que dato buscamos???")
If dato = "" Then Exit Sub
Set buscado = ActiveSheet.Range("m1:m" & Range("m150000").End(xlUp).Row).Find(dato, LookIn:=xlValues, lookat:=xlWhole)
If Not buscado Is Nothing Then
ubica = buscado.Address
do
buscado.EntireRow.Copy Destination:=Sheets("hoja2").Cells(filalibre, 1)
filalibre = filalibre +1
Set buscado = ActiveSheet.Range("m1:m" & Range("m150000").End(xlUp).Row).Findnext(buscado)
loop while not buscado is nothing and buscado.address <> ubica
End If
End Sub