+ Reply to Thread
Results 1 to 4 of 4

Autofilter - =string in selected cell

  1. #1
    al007
    Guest

    Autofilter - =string in selected cell

    Sub Autofilter()
    Selection.AutoFilter Field:=5, Criteria1:= _
    "=NPF", Operator:=xlAnd
    End Sub

    How can I amend above code to replace NPF with the contents of my
    active cell
    (E.g either by Application.InputBox type := ???
    or replace NPF by activecell.content ???)

    Thxs


  2. #2
    Gary Keramidas
    Guest

    Re: Autofilter - =string in selected cell

    did you try activecell.value ?

    --


    Gary


    "al007" <[email protected]> wrote in message
    news:[email protected]...
    > Sub Autofilter()
    > Selection.AutoFilter Field:=5, Criteria1:= _
    > "=NPF", Operator:=xlAnd
    > End Sub
    >
    > How can I amend above code to replace NPF with the contents of my
    > active cell
    > (E.g either by Application.InputBox type := ???
    > or replace NPF by activecell.content ???)
    >
    > Thxs
    >




  3. #3
    al007
    Guest

    Re: Autofilter - =string in selected cell

    Yes - I managed to make it work with active value but not if selected
    filter contains date - Can anybody help pls.

    Thxs


  4. #4
    Dave Peterson
    Guest

    Re: Autofilter - =string in selected cell

    You could try
    activecell.value2
    as your criteria.



    al007 wrote:
    >
    > Yes - I managed to make it work with active value but not if selected
    > filter contains date - Can anybody help pls.
    >
    > Thxs


    --

    Dave Peterson

+ 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