Closed Thread
Results 1 to 5 of 5

Auto Filter

  1. #1
    Registered User
    Join Date
    01-06-2006
    Location
    Omaha, NE
    Posts
    31

    Auto Filter

    Is it possible to use the value in cell A1 to filter the values in B1:B10? I am trying to use a user input to automatically set the auto filter rather than require the user to click the filter arrow and choose the filter value thay want. Thanks in advance.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    John, this might work for you. This assumes your criteria is in cell A1 (what you want to filter for), and your data is in column B starting in row 2. You don't want to start your data in row 1, since row 1 may get hidden (along with your criteria cell) if it doesn't equal the criteria value.

    Please Login or Register  to view this content.
    This updates anytime you change the criteria in cell A1. It even shows all your data if you change the value in A1 to nothing (blank).

  3. #3
    Registered User
    Join Date
    01-06-2006
    Location
    Omaha, NE
    Posts
    31
    Paul, thanks for the reply. Were would I put this? Is it like running a macro? Would they have to push a button for itt o execute? Thanks.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Open your worksheet, press ALT+F11 to open the vba window.

    Expand the branch for 'VBA Project (your workbook name)' until you see 'Sheet1', 'Sheet2', 'ThisWorkbook', etc.

    Double-click on the sheet that you want to apply the auto-filtering, and in the right-hand window paste the code I provided. You can then close the VBA window to return to your worksheet.

    This code works on the worksheet's SelectionChange event, so you don't have to press any buttons or run any macros manually. Whenever you change the value in cell A1 it will update the auto-filtered data in column B.

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867
    JohnGuts

    You are carrying this conversation with numerous members over at least two different formus, wasting the time of 3 (to date) forum members. Before posting, read the rules of either forum, and ask your question in one forum only.

    http://www.mrexcel.com/board2/viewtopic.php?t=265557

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

Closed 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