Solved

Want List Filter to be Updated Based on Value of Cell

Posted on 2011-03-09
2
261 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

808 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