ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advanced Filtering problem (https://www.excelbanter.com/excel-programming/362378-advanced-filtering-problem.html)

[email protected]

Advanced Filtering problem
 
When I try this code, all of rows 2 through rows 8 on the worksheet
"Test" are filtered and no longer visible.
I would have expected rows 3 through 4 and 6 through 7 to be filtered.
Can someone tell me what I am doping incorrectly?

tia
bob

Sheets("Test").Range("D1:D8").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Sheets("zzzzWorkSpaceSheet").Range( "A1:A5"), _
Unique:=False

Sheet:Test contains this data in Column D starting at row 1
HEADER
r
d
f
r
g
h
r

Sheet:zzzzWorkSpaceSheet contains this data in Column A starting at
row 1
Crit
d
f
g
h

Doug Glancy

Advanced Filtering problem
 
George,

Your zzzzWorkSheet should have this format:

In cells A1 to D1, enter the word "HEADER" (assuming that is really the
header name in the other sheet).
In A2 enter "d"
In B3 enter "f"
In C4 enter "g"
and in D5 enter "h"

To filter "d" OR "f" OR "g" OR "h" as you are doing here each criteria has
to be on a different row. Putting them in the same row is a logical AND.
Having them all in the same column as you did... well, I'm not sure what it
means, but it doesn't work.

hth,

Doug


wrote in message
...
When I try this code, all of rows 2 through rows 8 on the worksheet
"Test" are filtered and no longer visible.
I would have expected rows 3 through 4 and 6 through 7 to be filtered.
Can someone tell me what I am doping incorrectly?

tia
bob

Sheets("Test").Range("D1:D8").AdvancedFilter _
Action:=xlFilterInPlace, _
CriteriaRange:=Sheets("zzzzWorkSpaceSheet").Range( "A1:A5"), _
Unique:=False

Sheet:Test contains this data in Column D starting at row 1
HEADER
r
d
f
r
g
h
r

Sheet:zzzzWorkSpaceSheet contains this data in Column A starting at
row 1
Crit
d
f
g
h





All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com