LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Update Pivot Table Filters based on a Cell Value in Excel 2007

Hi there!

I'm new to VBA, and I have spent too much time already searching for
solution to my problem. My guess is that this will be trivial for you:

I want to update Pivot Table Filter based on a Cell Value.

For example, if I put atribute Year defined in my Time dimension into
Pivot Table Filter, I would like to update this Filter so it would
have the same value as a Cell "M1".

In Excel 2003 the code would be something like this:

ActiveSheet.PivotTables("PivotTable1").PivotFields ("Year").CurrentPage
= Range("M1")

However in Excel 2007 code is different:

ActiveSheet.PivotTables("PivotTable1").PivotFields ("[Time].[Year].
[Year]").CurrentPageName = ???

??? should be replaced with "[Time].[Year].[2010]" where
Range("M1")=2010

Any help is appreciated!

P.S. If I want to do the same with Month, and the Cell Value is
"March" (text instead of number), what changes do I have to do with my
code?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Print filters with Pivot Chart in Excel 2007 Alan J Excel Discussion (Misc queries) 0 December 21st 09 12:40 AM
Pivot Table filters, especially DATE filters chris Excel Worksheet Functions 0 August 27th 08 04:33 AM
Update a cell based on the pivot table refresh date syscrusher Excel Programming 0 August 15th 08 07:18 PM
Excel 2007 OLAP Pivot table Row Filters Wiley Excel Discussion (Misc queries) 0 April 26th 07 09:44 PM
update subtotals based on filters Ned Fraser Excel Worksheet Functions 3 March 22nd 07 02:08 AM


All times are GMT +1. The time now is 07:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"