+ Reply to Thread
Results 1 to 19 of 19

How to feed more than one pivot table froma cell

  1. #1
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    How to feed more than one pivot table froma cell

    test sheet pivot tables.xlsx

    Hi- I have a problem that needs solving- when i add a product code ( which will be from a data validation list) - I want it to autopopulate the filter sections of the pivot tables-as attached example.

    I think this may involve VBA but am not certain

    any help please

    !

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: How to feed more than one pivot table froma cell

    Hi Tradesman,

    It is hard to know what you really want here. Have you tried to use the SLICER tool on your pivots? That might be what you want.

    Also a Dynamic Named Range of your data and updating the Pivots when stuff is added might also be what you want.

    I wrote some code a few years ago that allowed 3 different pivots to show the same filters and that might also be what you want. See that attached:
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Hi Martin,

    bascially if I type ina product code in the cell - it actions the filters in the pivot table - slicers dont work!

    Ill google dynamic named range

    I was considering a VBA perhaps that when product coe is entered- button next to it action - it then takens that code and uses it in each filter??

  4. #4
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    this owrks for one pivot table but how do I add the second one- or more!

    Private Sub Worksheet_SelectionChange(ByVal Target As Range)

    'This line stops the worksheet updating on every change, it only updates when cell
    'B2 or B3 is touched
    If Intersect(Target, Range("B2:B3")) Is Nothing Then Exit Sub

    'Set the Variables to be used
    Dim pt As PivotTable
    Dim Field As PivotField
    Dim NewCat As String

    'Here you amend to suit your data
    Set pt = Worksheets("Sheet1").PivotTables("PivotTable1")
    Set Field = pt.PivotFields("product")
    NewCat = Worksheets("Sheet1").Range("B2").Value

    'This updates and refreshes the PIVOT table
    With pt
    Field.ClearAllFilters
    Field.CurrentPage = NewCat
    pt.RefreshTable
    End With

    End Sub

  5. #5
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Any help guys ??


    Sent from my iPhone using Tapatalk

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to feed more than one pivot table froma cell

    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  7. #7
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to feed more than one pivot table froma cell

    Please Login or Register  to view this content.
    added check for product codes that doesn't exist with helper cell "H2"
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    If there was a pivot table with 2 filters - 1 being the product - can this ignore non product filters


    Sent from my iPhone using Tapatalk

  9. #9
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to feed more than one pivot table froma cell

    it should
    it will look for the pivotfield named "product" to apply filter on only

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to feed more than one pivot table froma cell

    oh btw
    if you want it automatic
    put this code in sheet 1 as well
    Please Login or Register  to view this content.
    i took out the helper cell and put it into the code itself in this version as well
    Attached Files Attached Files
    Last edited by humdingaling; 04-22-2015 at 03:50 AM.

  11. #11
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Ive amneded it to my larger sheet but I get this occassionally

    screensht.JPG

    It has updated the pivot tables

  12. #12
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Ive amneded it to my larger sheet but I get this occassionally

    Attachment 390590

    It has updated the pivot tables

  13. #13
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Ok - the error is caused when a pivot table doesnt have a result. If there is an error the table filter should default to either nothing or ALL

    in excel I would probably use =IfERROR FUNCTION TO DEFAULT TO ZERO

  14. #14
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Hi Sorry to bump this up - but if one of the pivot tables doesnt show a result- then the debug screen pops up BUT NOT ALL PIVOT TABLES get updated??
    am I missing something

  15. #15
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to feed more than one pivot table froma cell

    you do realise australia and england are in different time zones.....

    anyway you adapted the code to your file but didn't include the file
    so i really dont know what you have done

    code for clear if not found, you can blank out the msgbox if you dont want it


    Please Login or Register  to view this content.
    also if one pivot table shows result and another doesn't it means you aren't using the same data for both pivot tables?

  16. #16
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Hi- sorry I didnt realise you were in Oz- ( thanks for the thrashing at cricket - lets hope we can do a little better at the rugby !)

    yes there is one pivot table that is based on a different data table- it does refer to a data colum with the same name Partno

    it seems to work but stop if one of the tables falls over

  17. #17
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to feed more than one pivot table froma cell

    we aim to please but everything in circles
    would like to see how we fair against England in the football actually

    having trouble seeing what is happening on your sheet
    are you able to provide sample

    pivot tables being what they are...its hard to replicate 100% without the example

  18. #18
    Forum Contributor
    Join Date
    10-25-2012
    Location
    london,england
    MS-Off Ver
    365 but on mac
    Posts
    137

    Re: How to feed more than one pivot table froma cell

    Sorry my sheet is 11meg !!! Great help I'll try and figure it out - it still falls over when there's no result from a table


    Sent from my iPhone using Tapatalk

  19. #19
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: How to feed more than one pivot table froma cell

    Please Login or Register  to view this content.
    This code is your check
    if the example it covers all the data but if it does it encompass all the data it needs to check in your version of the spreadsheet then you may need another layer of check or several

+ 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] Look UP formula froma pivot table
    By Excel Dumbo in forum Excel General
    Replies: 2
    Last Post: 01-18-2015, 10:12 PM
  2. Replies: 6
    Last Post: 07-31-2014, 12:56 PM
  3. To feed data from one cell of sheet1 to Data Table in sheet2
    By Hansni in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-06-2013, 11:18 PM
  4. Extracting value froma table
    By KP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2006, 01:00 PM
  5. Pivot as DB Feed - Rows with Repeating Display
    By mdalby in forum Excel General
    Replies: 0
    Last Post: 04-09-2005, 03:59 PM

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