+ Reply to Thread
Results 1 to 4 of 4

Help with code to Apply Filter to Pivot Table based on a cell value

  1. #1
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Help with code to Apply Filter to Pivot Table based on a cell value

    Hi

    I was wondering whether someone can help me with a seemingly simple question (im new to VB)

    I have a code which tries to apply a filter to my pivot table base on a value in a cell. So for example, in code below if ValCell is Mens then the pivot table would filter Men from Division Only.

    I have the following Code

    Please Login or Register  to view this content.
    The Name is passed thorough from this Code
    Please Login or Register  to view this content.
    What I need to do is to replace the Mens in first code ActiveSheet.Povottable.......... with a variable Name (which has the value of whatever selected in Sheet 1 Cells (8,"C").

    Any help is appreciate it

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Help with code to Apply Filter to Pivot Table based on a cell value

    Try

    Please Login or Register  to view this content.
    Martin

  3. #3
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with code to Apply Filter to Pivot Table based on a cell value

    Thanks for the reply

    I get the following error
    The item could not be found in OLAP Cube even though its in the filters (run time error 1004). The message box shows the correct name and I also cleared all the filters.

    Any idea

  4. #4
    Forum Contributor
    Join Date
    06-17-2014
    Location
    london
    MS-Off Ver
    365
    Posts
    398

    Re: Help with code to Apply Filter to Pivot Table based on a cell value

    Sorry it works now as I had a typo originally.

    Thank you so much for your help.

+ 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: 1
    Last Post: 04-05-2016, 10:35 AM
  2. Replies: 6
    Last Post: 07-31-2014, 12:56 PM
  3. [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
  4. vba code to filter pivot table column labels based on cell vaule
    By nailler167 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-31-2013, 09:12 PM
  5. 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
  6. Apply filter in a pivot table
    By luis87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2010, 01:22 PM
  7. 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