+ Reply to Thread
Results 1 to 3 of 3

How to use a cell value as a criteria (*contains*) in autofilter?

  1. #1
    Registered User
    Join Date
    05-17-2012
    Location
    Pune India
    MS-Off Ver
    Excel 2007
    Posts
    2

    How to use a cell value as a criteria (*contains*) in autofilter?

    Please go through the code and help me in using CONTAINS option :
    (exact match option for filter works fine but not "contains")

    Dim r As String
    Range("B2").Select
    Selection.Copy
    r = Range("B2").Value
    ActiveSheet.Range("$A$1:$B$80000").AutoFilter Field:=1, Criteria1:=*r*, Operator:=xlOr, Criteria2:="=*RC=*"

    Without the astric in criteria1 runs fine but that filters for an exact match and I want the contains filtering.

    Thanks in Advance!!!
    Regards,
    Ashish Shukla

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: How to use a cell value as a criteria (*contains*) in autofilter?

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-17-2012
    Location
    Pune India
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How to use a cell value as a criteria (*contains*) in autofilter?

    Thanks a lot SIR!!!!

    YOU ARE AWESOME

+ 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