+ Reply to Thread
Results 1 to 10 of 10

Filter pivot by reference

  1. #1
    Registered User
    Join Date
    01-25-2014
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    16

    Filter pivot by reference

    Hi All,

    I can't find the solution on below problem... is there anyone who already faced with this challange?

    I have a sheet with all days of a year. Once I passed a day I have certain result shows in %.
    So I made a pivot to filter data and a chart to show results.

    But... I'd like to make this more smart via ... fill two cell those contains dates as range - I'd use these as certain filter in pivot on date column.

    The idea is this:

    - after I type a new date into these cells, the Pivot sould automatically refresh itself and shows all date (lines) between the two value I gave and refresh a chart that belongs to this pivot..

    Example:
    a1.jpg

    Thanks for your help in advance!

  2. #2
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Filter pivot by reference

    Hi,
    If you know VBA and Events then sort the Pivot row label using your "From" and "Till".
    Lokesh Kumar
    Stay Hungry.. Stay Foolish..
    _________________________________________________________
    Please Click STAR to Add Reputation if my/someone's answer helped!

  3. #3
    Registered User
    Join Date
    01-25-2014
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Filter pivot by reference

    Hi Kumar,

    I tried in several ways... but for some reason it not works with cell values as data range

    ActiveSheet.PivotTables("pivot2").PivotFields("Date").ClearAllFilters
    ActiveSheet.PivotTables("pivot2").PivotFields("Date").PivotFilters.Add _
    Type:=xlDateBetween, Value1:="B1", Value2:="D1"

    I couldn't validate the same data in date coulmn as from and till - so I'm not sure how can give the proper range..

  4. #4
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Filter pivot by reference

    Hi,
    I got it......I said
    and Events
    .
    Upload your sample file....Please

  5. #5
    Registered User
    Join Date
    01-25-2014
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Filter pivot by reference

    test1.xlsm

    Hello Kumar,

    Enclosed...

    thanks

  6. #6
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Filter pivot by reference

    Hi,
    Pls check......
    test1.xlsm

  7. #7
    Registered User
    Join Date
    01-25-2014
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Filter pivot by reference

    Hi,
    It cause runtime error '1004' - says date is invalid.

    Problem with this part:
    ActiveSheet.PivotTables("Kimutatás5").PivotFields("Date").PivotFilters.Add _
    Type:=xlDateBetween, Value1:=[c2], Value2:=[E2]

  8. #8
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Filter pivot by reference

    Hey,
    Its working correctly on my system.

  9. #9
    Registered User
    Join Date
    01-25-2014
    Location
    Hungary
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: Filter pivot by reference

    Lucky you, not on mine
    Anyway thank for your effort!

  10. #10
    Forum Contributor LokeshKumar's Avatar
    Join Date
    03-31-2015
    Location
    India
    MS-Off Ver
    All, mostly 2010 now..
    Posts
    471

    Re: Filter pivot by reference

    Hi,

    If you have the team viewer then message me..
    http://facebook.com/lokesh.kumar86

+ 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. VBA - Filter a Pivot Table field using "contains" keyword from cell reference?
    By andya in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-22-2016, 08:26 AM
  2. Macro to filter a pivot whilst looping through filter criteria in a variable list.
    By Alistairm88 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2015, 04:25 AM
  3. MACRO - Pivot filter based on cell reference
    By maikoz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-24-2014, 04:02 AM
  4. [SOLVED] Excel Macro: Filter all pivot tables in workbook from a source(reference)
    By moxman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-10-2013, 09:46 PM
  5. One filter/ Master filter multiple pivot tables based on worksheet...
    By jlworden in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-10-2013, 11:16 AM
  6. 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
  7. Filter several pivot tables by one programmed date range filter in Excel 2003
    By olewka in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2011, 11:49 AM

Tags for this Thread

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