+ Reply to Thread
Results 1 to 2 of 2

Pivot table filter based on text box or cell value, vba?

Hybrid View

boniouk Pivot table filter based on... 12-24-2013, 07:22 AM
protonLeah Re: Pivot table filter based... 12-29-2013, 08:14 PM
  1. #1
    Registered User
    Join Date
    12-18-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    2

    Pivot table filter based on text box or cell value, vba?

    Hi.

    I have a massive (500,000k rows) data dump of safety checks carried out on employes.
    The column data i have is...

    Team - Name - ID - Check No

    what i want is a cell or text box at the top whereby i can start to enter an ID or Team and the filter will automatically start drilling down on my data. So if i enter 603, the staff with IDs starting with 603 will be shown, and all of their checks on the right. each name/id is repeated for each check so it will pull all the correct data, just not sure how to write the VBA code for it.

    Any ideas?


    I found this online,

    Private Sub TextBox1_Change()
    Dim s As String
    s = TextBox1
    Range("A1").AutoFilter Field:=3, Criteria1:=s & "*", Operator:=xlAnd
    End Sub


    however this was to search for a ID eg, ABC. I want it to search for numbers, eg, 600109232. When i start typing 6, i get no results. something to do with text/numbers maybe.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,936

    Re: Pivot table filter based on text box or cell value, vba?

    What column are the ID's in? What is the first row with data?
    Ben Van Johnson

+ 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. [SOLVED] Filter Pivot Table Based on Cell Value
    By cp41 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2013, 07:24 AM
  2. Using VBA to filter Pivot Table based on a cell value
    By doolsey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2013, 08:24 AM
  3. Change Pivot table Filter Based on Cell Value *Multiple Filter items* Possible?
    By Flydd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-27-2012, 06:57 AM
  4. Filter a Pivot table based on cell in another workbook
    By nicknorth34 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-14-2011, 02:41 PM
  5. Filter Pivot Table Based on Cell Value
    By LB79 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-26-2009, 08:07 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