+ Reply to Thread
Results 1 to 2 of 2

Advanced Filtering problem

  1. #1

    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

  2. #2
    Doug Glancy
    Guest

    Re: 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


    <[email protected]> wrote in message
    news:[email protected]...
    > 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




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1