+ Reply to Thread
Results 1 to 11 of 11

Pivot Table to filter according to cell value

  1. #1
    Registered User
    Join Date
    11-07-2014
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    10

    Question Pivot Table to filter according to cell value

    I am trying to put together code to have my pivot table filter down it's "Location" value/field to filter down to the inputted value in E5 (all on the same sheet). I've spent hours trying various codes I have found but haven't had success.
    Can someone please help?


    Sheet name: Demographics Summary
    Pivot name: PivotTable1
    Cell value: E5

  2. #2
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Pivot Table to filter according to cell value

    Hi welcome to the forum : ), there is no attachment, post it...
    Click just below left if it helps, Boo?ath?

  3. #3
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Pivot Table to filter according to cell value

    having said that alternative you can try with multiple cons ranges with pivito table, to open short cut alt+d+p+e, selected mutiple con ranges and go thrru wizard

  4. #4
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Pivot Table to filter according to cell value


  5. #5
    Registered User
    Join Date
    11-07-2014
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    10

    Re: Pivot Table to filter according to cell value

    I have attached, thanks!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-07-2014
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    10

    Re: Pivot Table to filter according to cell value

    This looked promising but did not work. What am I doing wrong?

    I right clicked on fist tab, right clicked, view code and pasted:

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Address(0, 0) = "E5" Then
    With Sheets("Demographics Summary").PivotTables(1).PageFields("Location")
    If Target <> "" Then
    On Error Resume Next
    .CurrentPage = .PivotItems(Target.Value).Name
    On Error GoTo 0
    Else
    .CurrentPage = "All"
    End If
    End With
    End If
    End Sub

  7. #7
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Pivot Table to filter according to cell value

    Quote Originally Posted by torrmel9701 View Post
    I have attached, thanks!

    Hi, data source is not there, pl post it with some datas which can be used for pivot

  8. #8
    Registered User
    Join Date
    11-07-2014
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    10

    Re: Pivot Table to filter according to cell value

    W/ data source, sorry about that.
    Attached Files Attached Files

  9. #9
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Pivot Table to filter according to cell value

    HI, Refer the attachment
    Attached Files Attached Files

  10. #10
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Pivot Table to filter according to cell value

    You can apply the values in filter areas as well as row/column areas

  11. #11
    Registered User
    Join Date
    11-07-2014
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    10

    Re: Pivot Table to filter according to cell value

    Thanks for the response but after looking at the WB it's not what I was looking for. What I need is when E5 on the first tab (in red) has a value, that value filters down the pivot table at the bottom right. So that 4 digit number currently in there will filter the pivot location to match that value in E5 (4 digit number).
    Attached Files Attached Files

+ 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. Replies: 6
    Last Post: 07-31-2014, 12:56 PM
  2. Pivot table, assigning a cell wo be change the Pivot table filter
    By jwongsf in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2012, 05:00 PM
  3. Pivot table filter from cell value
    By bravebart in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-14-2012, 09:51 AM
  4. 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
  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