Autofilter Using Form Value

  • Hi


    I am trying to use a value entered on a form by the user to use as part of an auto-filter process. The code (which isn't working!) is below:


    Selection.AutoFilter Field:=13, Criteria1:="=*&TxtDescr.Value*", Operator:=xlAnd"


    The code should say 'field contains' the TxtDescr.Value.


    Any ideas (please!)


    Thanks


    Aaron

  • Re: Autofilter Using Form Value


    Try this (not tested):

    Code
    Selection.AutoFilter Field:=13, Criteria1:="=*" & TxtDescr.Value & "*", Operator:=xlAnd"


    Hope this helps out!

    Barrie Davidson
    My Excel Web Page
    "You're only given a little spark of madness. You mustn't lose it." - Robin Williams

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!