+ Reply to Thread
Results 1 to 4 of 4

VBA to Filter Based on Cell Value - Exact Match Only

  1. #1
    Registered User
    Join Date
    11-15-2007
    Posts
    57

    VBA to Filter Based on Cell Value - Exact Match Only

    I am a volunteer committee member for a local football league and one of my tasks is to collate a list of teams who have not submitted reports for some/all of their matches and e-mail this list to the team manager and their club secretary.

    I am using the code below:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target = Range("g2") Then
    Range("A6:a1182").CurrentRegion.AdvancedFilter _
    Action:=xlFilterInPlace, _
    CriteriaRange:=Range("g1:g2")
    End If
    End Sub
    This appears to bring up all records containing the data in cell G2 but I need only those records that are an exact match with cell G2.

    Please could someone tell me where I am going wrong.

    Thanks in advance.

  2. #2
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,515

    Re: VBA to Filter Based on Cell Value - Exact Match Only

    In your cell G2 type this.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  3. #3
    Registered User
    Join Date
    11-15-2007
    Posts
    57

    Re: VBA to Filter Based on Cell Value - Exact Match Only

    Brilliant.

    Thank you, that worked perfectly

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,515

    Re: VBA to Filter Based on Cell Value - Exact Match Only

    You're welcome.
    If this takes care of your question please mark the thread as Solved.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How do I make advanced filter do exact match only?
    By blogger153 in forum Excel General
    Replies: 2
    Last Post: 11-29-2015, 11:30 PM
  2. [SOLVED] array filter that returns text if an exact match only
    By mcdermott2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-10-2015, 06:13 PM
  3. Filter column by exact match?
    By mikey42979 in forum Excel General
    Replies: 6
    Last Post: 06-20-2013, 11:21 AM
  4. [SOLVED] Filter matrix based on a non-exact match
    By douglascaixeta in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-31-2013, 04:32 PM
  5. Replies: 4
    Last Post: 12-14-2009, 03:21 PM
  6. Filter function - exact match...
    By pmguerra in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2006, 09:48 AM
  7. Advance filter search does not filter an exact match
    By cfiiland in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2005, 08:05 AM

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