Filter Problem??
Eliminate Pivot Table Annoyances
Thanks Thanks:  0
Likes Likes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Filter Problem??

  1. #1
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Selection.AutoFilter Field:=8, Criteria1:=(<=dollarvalue), Operator:= _
    xlAnd
    what is wrong with the above I want to filter to less than or equal to dollarvalue
    I have dim'd dollarvalue nothing seems to work help?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Shouldn't criteria be a cell range consider of no less that 2 rows?

  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    It was recorded code I want to filter by a specified dollar amount eg $100 using a variable any other code would be of help?

  4. #4
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Ahh, sorry thought this was an Advanced AutoFilter. Is Field 8 your dollar amount field? You should be entering <=100.

    Selection.AutoFilter Field:=8, Criteria1:="<=100", Operator:=xlAnd

    [ This Message was edited by: Mark W. on 2002-03-14 15:04 ]

  5. #5
    Board Regular Steve Hartman's Avatar
    Join Date
    Feb 2002
    Location
    Houston,Texas
    Posts
    417
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-14 14:47, brettvba wrote:
    Selection.AutoFilter Field:=8, Criteria1:=(<=dollarvalue), Operator:= _
    xlAnd
    Try replacing the parenthesis with double quotes and drop the operator statement

    Selection.AutoFilter Field:=8, Criteria1:="<=dollarvalue"

  6. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    that would work for text but i'm putting a variable in their, this is an autofilter thats being customised.

  7. #7
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Austin, Texas USA
    Posts
    11,654
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-14 15:03, brettvba wrote:
    that would work for text but i'm putting a variable in their, this is an autofilter thats being customised.
    See my edited response above.

  8. #8
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I can do it to equal the variable by
    Selection.AutoFilter Field:=8, Criteria1:=(dollarvalue), Operator:= _
    xlAnd
    but not less than or equal to?

  9. #9
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Christchurch New Zealand
    Posts
    1,030
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    so what your saying mark is that you can't put a variable in a filter unless its equal to it?

  10. #10
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    81,772
    Post Thanks / Like
    Mentioned
    11 Post(s)
    Tagged
    1 Thread(s)

    Default

      
    On 2002-03-14 15:05, brettvba wrote:
    I can do it to equal the variable by
    Selection.AutoFilter Field:=8, Criteria1:=(dollarvalue), Operator:= _
    xlAnd
    but not less than or equal to?
    Would the & trick not work -- Criteria1:="<="&E1 where E1 houses a crit value?

    Aladin

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com