Solved

Want List Filter to be Updated Based on Value of Cell

Posted on 2011-03-09
2
260 Views
Last Modified: 2012-05-11
I have a list that I would like to be filtered based on the value in a cell.
In the attached file, there are two sheets.
The first sheet is the complete list of books and authors.
The second sheet is a filtered list based on "*mi* being contained in the author's name.
I would like to change the value of *mi* to something else and have the list automatically filtered.
List-of-Books.xls
0
Comment
Question by:Alex972
2 Comments
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 500 total points
ID: 35086453
Is this what you want?

Sample File Attached. Simply chnage the value in B2

Code Used in the worksheet "Queries"

Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    If Not Intersect(Target, Range("B2")) Is Nothing Then
        ActiveSheet.ListObjects("List1").Range.AutoFilter Field:=2, Criteria1:= _
        "=" & Range("B2"), Operator:=xlAnd
    End If
    Application.EnableEvents = True
End Sub

Open in new window

List-of-Books.xls
0
 
LVL 1

Author Closing Comment

by:Alex972
ID: 35086942
Very cool!! Just what I was looking for.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question