Ver Mensaje Individual
  #1 (permalink)  
Antiguo 26/12/2013, 10:39
DN2013
 
Fecha de Ingreso: diciembre-2013
Ubicación: Lima
Mensajes: 1
Antigüedad: 10 años, 4 meses
Puntos: 0
Consulta de datos con más de un filtro

Estimados, primera vez en este foro, espero me ayuden

En la hoja 1 tengo una tabla de datos en columnas A,B,C,D,E,F,G
En la hoja 2 tengo tres selectores (filtros) de datos de las columnas A,B,C de la tabla de la hoja 1
lo que deseo es que en la hoja 2 un botón BUSCAR me arroje el siguiente resultado en la hoja 3:
todas las columnas donde los selectores de A,B,C de la hoja 2 coincidan con la hoja 1.
Evidentemente si no filtro me deben mostrar todos los datos de la hoja 1
Si 2.A = 1.A,2.B=todos,2.C=todos, la hoja 3 debe mostrar todos los campos filtrados por A.
Si 2.A = 1.A,2.B=1.B,2.C=todos, la hoja 3 debe mostrar todos los campos filtrados por A y B
Si 2.A = 1.A,2.B=1.B,2.C=1.C, la hoja 3 debe mostrar todos los campos filtrados por A, B y C
etc

Solo me ha salido con un filtro

Cita:
Sub Search()
Application.ScreenUpdating = False

Dim filac, filabr, filam As Integer

filac = 2
filabr = 2
filam = 2
'On Error Resume Next

While Sheets("code").Cells(filac, 1) <> Empty
While Sheets("branch").Cells(filabr, 1) <> Empty
dato1 = Sheets("code").Cells(filac, 1)
dato2 = Sheets("branch").Cells(filabr, 1)

If Sheets("code").Cells(filac, 1) = Sheets("branch").Cells(filabr, 1) Then

Sheets("main").Cells(filam, 1) = Sheets("branch").Cells(filabr, 1)
Sheets("main").Cells(filam, 2) = Sheets("branch").Cells(filabr, 2)
Sheets("main").Cells(filam, 3) = Sheets("branch").Cells(filabr, 3)
Sheets("main").Cells(filam, 4) = Sheets("branch").Cells(filabr, 4)
Sheets("main").Cells(filam, 5) = Sheets("branch").Cells(filabr, 5)
Sheets("main").Cells(filam, 6) = Sheets("branch").Cells(filabr, 6)
Sheets("main").Cells(filam, 7) = Sheets("branch").Cells(filabr, 7)
Sheets("main").Cells(filam, 8) = Sheets("branch").Cells(filabr, 8)
Sheets("main").Cells(filam, 9) = Sheets("branch").Cells(filabr, 9)
Sheets("main").Cells(filam, 10) = Sheets("branch").Cells(filabr, 10)
Sheets("main").Cells(filam, 11) = Sheets("branch").Cells(filabr, 11)

filam = filam + 1
End If

filabr = filabr + 1
Wend


filac = filac + 1
filabr = 2

Wend

Application.ScreenUpdating = True
End Sub
Gracias de antemano

Última edición por DN2013; 26/12/2013 a las 10:54