Consulting

Results 1 to 4 of 4

Thread: Sleeper: Filter Problems

  1. #1

    Angry Sleeper: Filter Problems

    Hi,

    I use the below code to filter a spreadsheet I have and copy to another sheet. I have just added some more rows (using a form - as I did for all rows of data), but the filter doesn't seem to want to pick up the new rows. I can filter on Size, type, name, manager and view all. Up until now these have all worked. I have added 3 new lines and size, type and manager bring back no rows if filter is asking for one of the 3 new rows, name works fine and view all just removes the 3 new lines. Any ideas why this might be??

    Option Explicit
    
    Sub Advanced_Filter()
    Application.ScreenUpdating = False
    Range("A1:K1").Select
    Range(Selection, Selection.End(xlDown)).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
    "Criteria"), CopyToRange:=Range("Output!A11:K11"), Unique:=False
    Sheets("Output").Select
    Range("A12").Select
    Sheets("DataSheet").Visible = False
    If IsEmpty(Range("A12")) Then
        MsgBox ("No Results Found Based On Your Search Criteria - Please Refine and Try Again!")
    End If
    Application.ScreenUpdating = True
    End Sub

    Many thanks in advance

  2. #2
    Administrator
    2nd VP-Knowledge Base
    VBAX Master malik641's Avatar
    Joined
    Jul 2005
    Location
    Florida baby!
    Posts
    1,533
    Location
    I get an error here:

    Range(Selection, Selection.End(xlDown)).AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
    "Criteria"), CopyToRange:=Range("Output!A11:K11"), Unique:=False
    At the _Global range "Criteria". What are you using for the "Criteria" range??




    New to the forum? Check out our Introductions section to get to know some of the members here. Feel free to tell us a little about yourself as well.

  3. #3
    My criteria range is P3:Q4, and the P3:Q3 range has the exact titles of the source data and the P4:Q4 has the exact same terms as the source data too.

  4. #4
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Can you zip/upload a sample file?

Posting Permissions

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