+ Reply to Thread
Results 1 to 5 of 5

Filter in macro

  1. #1
    POM
    Guest

    Filter in macro

    Hi

    I'm trying to filter a table in a macro by the contents of a cell which is
    outside the table range. (Basically, the user, on a separate sheet picks
    from a list box what they want to filter by, and the results go into a linked
    cell as usual). At present I am using AutoFilter, but can't seem to put the
    cell reference in the Criteria1? Is it possible or am I using incorrect
    syntax?

    Any help would be great!

  2. #2
    Guest

    Filter in macro

    hi,
    how do we know if your are using incorrect syntax unless
    you post your code?

    >-----Original Message-----
    >Hi
    >
    >I'm trying to filter a table in a macro by the contents

    of a cell which is
    >outside the table range. (Basically, the user, on a

    separate sheet picks
    >from a list box what they want to filter by, and the

    results go into a linked
    >cell as usual). At present I am using AutoFilter, but

    can't seem to put the
    >cell reference in the Criteria1? Is it possible or am I

    using incorrect
    >syntax?
    >
    >Any help would be great!
    >.
    >


  3. #3
    POM
    Guest

    RE: Filter in macro

    you could just possibly tell me the correct syntax!


    "anonymous@discussions.microsoft.com" wrote:

    > hi,
    > how do we know if your are using incorrect syntax unless
    > you post your code?
    >
    > >-----Original Message-----
    > >Hi
    > >
    > >I'm trying to filter a table in a macro by the contents

    > of a cell which is
    > >outside the table range. (Basically, the user, on a

    > separate sheet picks
    > >from a list box what they want to filter by, and the

    > results go into a linked
    > >cell as usual). At present I am using AutoFilter, but

    > can't seem to put the
    > >cell reference in the Criteria1? Is it possible or am I

    > using incorrect
    > >syntax?
    > >
    > >Any help would be great!
    > >.
    > >

    >


  4. #4
    Tom Ogilvy
    Guest

    Re: Filter in macro

    Assume I record myself applying an autofilter. I get

    Selection.AutoFilter Field:=3, Criteria1:="6"

    for the criteria argument you could replace the "6" with the range where
    the criteria is stored

    Criteria1:=Range("M10").Text


    --
    Regards,
    Tom Ogilvy


    "POM" <POM@discussions.microsoft.com> wrote in message
    news:DF56AC42-7C55-4E92-9922-0751850CEDAA@microsoft.com...
    > you could just possibly tell me the correct syntax!
    >
    >
    > "anonymous@discussions.microsoft.com" wrote:
    >
    > > hi,
    > > how do we know if your are using incorrect syntax unless
    > > you post your code?
    > >
    > > >-----Original Message-----
    > > >Hi
    > > >
    > > >I'm trying to filter a table in a macro by the contents

    > > of a cell which is
    > > >outside the table range. (Basically, the user, on a

    > > separate sheet picks
    > > >from a list box what they want to filter by, and the

    > > results go into a linked
    > > >cell as usual). At present I am using AutoFilter, but

    > > can't seem to put the
    > > >cell reference in the Criteria1? Is it possible or am I

    > > using incorrect
    > > >syntax?
    > > >
    > > >Any help would be great!
    > > >.
    > > >

    > >




  5. #5
    POM
    Guest

    Re: Filter in macro

    Thanks for the help Tom - just what I needed!


    "Tom Ogilvy" wrote:

    > Assume I record myself applying an autofilter. I get
    >
    > Selection.AutoFilter Field:=3, Criteria1:="6"
    >
    > for the criteria argument you could replace the "6" with the range where
    > the criteria is stored
    >
    > Criteria1:=Range("M10").Text
    >
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "POM" <POM@discussions.microsoft.com> wrote in message
    > news:DF56AC42-7C55-4E92-9922-0751850CEDAA@microsoft.com...
    > > you could just possibly tell me the correct syntax!
    > >
    > >
    > > "anonymous@discussions.microsoft.com" wrote:
    > >
    > > > hi,
    > > > how do we know if your are using incorrect syntax unless
    > > > you post your code?
    > > >
    > > > >-----Original Message-----
    > > > >Hi
    > > > >
    > > > >I'm trying to filter a table in a macro by the contents
    > > > of a cell which is
    > > > >outside the table range. (Basically, the user, on a
    > > > separate sheet picks
    > > > >from a list box what they want to filter by, and the
    > > > results go into a linked
    > > > >cell as usual). At present I am using AutoFilter, but
    > > > can't seem to put the
    > > > >cell reference in the Criteria1? Is it possible or am I
    > > > using incorrect
    > > > >syntax?
    > > > >
    > > > >Any help would be great!
    > > > >.
    > > > >
    > > >

    >
    >
    >


+ 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