+ Reply to Thread
Results 1 to 2 of 2

AdvandcedFilter - Oh I need help

  1. #1
    Bob Sandor
    Guest

    AdvandcedFilter - Oh I need help

    Hi everyone,
    I have a spreadsheet which has about 16000 rows. I have a sheet
    entitled "Raw Data", and in the first column, "ID", contains an
    identifier that is not unique. Meaning, there are many Identifiers,
    and they show up multiple times each. Row 1 is a header row. For
    example:

    A B
    ----- -----------------------
    ID Data
    1 blah
    1 more blah
    2 blah
    2 blah
    3 even more blah
    3 blah blah
    3 blah
    5 blah, blah, infinity!
    .... and so on, and so on.

    My end goal is to be able to filter the sheet with an "inclusion"
    list. I want to be able to say, "keep ID 1, 3, and 5 and filter out
    all the rest." I have a macro which does this with brute force, going
    line by line and deleting rows that don't belong. After hunting for a
    faster solution I found Advancedfilter. I can't seem to get it to work
    though.

    I've now added a sheet to my workbook called "Filter", and in that I
    created a list and named it "AppFilter". No header row. For example:

    A
    -----
    1
    3
    5


    Here's a code snippet from my sub:

    ' This is my range containing all the rows and columns of raw data
    Set myRange = Sheets("Raw Data").Range(Cells(1, 1), _
    Cells(LastCell.row, LastCell.Column))

    ' Attempting to filter my range
    myRange.AdvancedFilter xlFilterInPlace, _
    Sheets("Filter").Range("AppFilter"), _
    False

    When I run my code, nothing seems to happen. My screen blinks and the
    macro finishes running, but no filtering occurs. I recieve no errors,
    and stepping through the code doesn't seem to help at all. Do I have a
    misunderstanding of how this function works.

    Any ideas?

    - Bob


  2. #2
    Debra Dalgleish
    Guest

    Re: AdvandcedFilter - Oh I need help

    The criteria area should have the same heading as column A in the data
    range.


    Bob Sandor wrote:
    > Hi everyone,
    > I have a spreadsheet which has about 16000 rows. I have a sheet
    > entitled "Raw Data", and in the first column, "ID", contains an
    > identifier that is not unique. Meaning, there are many Identifiers,
    > and they show up multiple times each. Row 1 is a header row. For
    > example:
    >
    > A B
    > ----- -----------------------
    > ID Data
    > 1 blah
    > 1 more blah
    > 2 blah
    > 2 blah
    > 3 even more blah
    > 3 blah blah
    > 3 blah
    > 5 blah, blah, infinity!
    > ... and so on, and so on.
    >
    > My end goal is to be able to filter the sheet with an "inclusion"
    > list. I want to be able to say, "keep ID 1, 3, and 5 and filter out
    > all the rest." I have a macro which does this with brute force, going
    > line by line and deleting rows that don't belong. After hunting for a
    > faster solution I found Advancedfilter. I can't seem to get it to work
    > though.
    >
    > I've now added a sheet to my workbook called "Filter", and in that I
    > created a list and named it "AppFilter". No header row. For example:
    >
    > A
    > -----
    > 1
    > 3
    > 5
    >
    >
    > Here's a code snippet from my sub:
    >
    > ' This is my range containing all the rows and columns of raw data
    > Set myRange = Sheets("Raw Data").Range(Cells(1, 1), _
    > Cells(LastCell.row, LastCell.Column))
    >
    > ' Attempting to filter my range
    > myRange.AdvancedFilter xlFilterInPlace, _
    > Sheets("Filter").Range("AppFilter"), _
    > False
    >
    > When I run my code, nothing seems to happen. My screen blinks and the
    > macro finishes running, but no filtering occurs. I recieve no errors,
    > and stepping through the code doesn't seem to help at all. Do I have a
    > misunderstanding of how this function works.
    >
    > Any ideas?
    >
    > - Bob
    >



    --
    Debra Dalgleish
    Excel FAQ, Tips & Book List
    http://www.contextures.com/tiptech.html


+ 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