+ Reply to Thread
Results 1 to 4 of 4

Advance Filter

  1. #1
    Registered User
    Join Date
    03-17-2006
    Posts
    16

    Advance Filter

    Finally I have managed to build a search tool using Advance Filter, It run well as a macro. I can search customer details by their membership numbers.

    My question is there a way I can define the filter further e.g. I can input the membership and city details i.e. membership No. (123456) and City (Nottingham) at the same time and use one button to run the macro for the search. The code below only lets me put in one search

    Sub search2()
    '
    ' search2 Macro
    ' Macro recorded 22/03/2006 by s
    '

    '
    Range("A10").Select
    Range("A10:A25").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
    Range("A1:A2"), Unique:=False
    End Sub

  2. #2
    Peo Sjoblom
    Guest

    Re: Advance Filter

    What do you have in A2?


    --

    Regards,

    Peo Sjoblom


    "Obi-Wan Kenobi"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > Finally I have managed to build a search tool using Advance Filter, It
    > run well as a macro. I can search customer details by their membership
    > numbers.
    >
    > My question is there a way I can define the filter further e.g. I can
    > input the membership and city details i.e. membership No. (123456) and
    > City (Nottingham) at the same time and use one button to run the macro
    > for the search. The code below only lets me put in one search
    >
    > Sub search2()
    > '
    > ' search2 Macro
    > ' Macro recorded 22/03/2006 by s
    > '
    >
    > '
    > Range("A10").Select
    > Range("A10:A25").AdvancedFilter Action:=xlFilterInPlace,
    > CriteriaRange:= _
    > Range("A1:A2"), Unique:=False
    > End Sub
    >
    >
    > --
    > Obi-Wan Kenobi
    > ------------------------------------------------------------------------
    > Obi-Wan Kenobi's Profile:
    > http://www.excelforum.com/member.php...o&userid=32578
    > View this thread: http://www.excelforum.com/showthread...hreadid=525404
    >




  3. #3
    Registered User
    Join Date
    03-17-2006
    Posts
    16

    reply to advance filter

    A2 is the search field, I type in what I am searching for and it filters it from the spreadsheet which starts from A10.

    A1 is the title of the search field e.g membership no.
    A2 is were I type in the number e.g. 123456

    A10 is the start of the spreadsheet from with the membership number is filterd from

  4. #4
    Peo Sjoblom
    Guest

    Re: Advance Filter

    Then you need to use 4 cells instead of 2, in A1 membership no. in B1 city
    in A2 12345 in B2 Nottingham

    then in the macro

    CriteriaRange:= _
    Range("A1:B2"), Unique:=False



    --

    Regards,

    Peo Sjoblom





    "Obi-Wan Kenobi"
    <[email protected]> wrote in
    message news:[email protected]...
    >
    > A2 is the search field, I type in what I am searching for and it filters
    > it from the spreadsheet which starts from A10.
    >
    > A1 is the title of the search field e.g membership no.
    > A2 is were I type in the number e.g. 123456
    >
    > A10 is the start of the spreadsheet from with the membership number is
    > filterd from
    >
    >
    > --
    > Obi-Wan Kenobi
    > ------------------------------------------------------------------------
    > Obi-Wan Kenobi's Profile:
    > http://www.excelforum.com/member.php...o&userid=32578
    > View this thread: http://www.excelforum.com/showthread...hreadid=525404
    >




+ 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