Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 17th, 2006, 02:57 PM
Authorized User
 
Join Date: Oct 2005
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dynamic Pivot Table Filter??

Is there anyway I can Filter one of the fields a pivot table shows based on the content of a cell?

Example:
I create a generic pivot table that shows all data but when the spreadsheet loads it looks at that cell and filters the data. Anyone know of how to make this work OR a better way to do this?

 
Old February 21st, 2006, 01:27 AM
Registered User
 
Join Date: Feb 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Wulffman Send a message via MSN to Wulffman
Default

I am getting close to this.

I have 2 cells with drop down lists.

I have a macro that I manually fire:

Sub UpdatePivots()
    a = Worksheets("BuildQry").Cells(6, 1)
    Sheets("BuildQry").PivotTables("PivotTable2").Pivo tFields("ITDept").CurrentPage = a
    a = Worksheets("BuildQry").Cells(8, 1)
    Sheets("BuildQry").PivotTables("PivotTable4").Pivo tFields("ITName").CurrentPage = a
End Sub

This causes the pivot table to be updated based on the contents of the two cells. I am struggling with getting the macro to fire on the DropButtonClick() Event:

Private Sub Worksheet_DropButtonClick()
    a = Worksheets("BuildQry").Cells(6, 1)
    Sheets("BuildQry").PivotTables("PivotTable2").Pivo tFields("ITDept").CurrentPage = a
    a = Worksheets("BuildQry").Cells(8, 1)
    Sheets("BuildQry").PivotTables("PivotTable4").Pivo tFields("ITName").CurrentPage = a
End Sub

I will post if I get thru my struggles. Take care. -t






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use Dynamic Filter on ObjectDataSource onlinedev ASP.NET 2.0 Basics 0 December 5th, 2007 03:21 PM
Pivot Table Dynamic Reference Data oyelesit Excel VBA 2 August 4th, 2006 07:28 AM
Pivot Table vbsolo Excel VBA 3 November 23rd, 2005 01:28 AM
Pivot Table mikeparams SQL Server 2000 1 February 9th, 2005 10:10 AM
Dynamic Filter Form, need tip jbash111 Access 3 January 24th, 2005 12:54 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.