Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 114
Default Controlling Pivot Table Field Page-2

Dear All,

I hope someone can help me out. I am a VBA dummy but would like to do this.

There are 4 things I want to be able to do:

1. Cell $B$24 controls 2 pivot table field on the same page. (unlimited
specific would be great!!)

2. Cell $B$24 controls 2 pivot table field on different worksheets.

3. Pivot Table Field 1("Month Ended -----") controls pivot table field 2
("Month Ended") .

4. Cell $B$24 is a formula =Sheet1!A2 or a vlookup, and if this cell
changes, the pivot field also changes.


This is the script I have:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
Dim pf As PivotField
Dim pf1 As PivotField
Dim pi As PivotItem

Set pt = Worksheets("Page 1-Summary").PivotTables(1)
Set pf = pt.PageFields("Month Ended" & "Month Ended -----") <--------- i
tried adding this...lol

Set pf1 = pt.PageFields()<--------------- i tried adding this..lol

If Target.Address = "$B$24" Then

Application.EnableEvents = False

For Each pi In pf.PivotItems
'For Each pi In pf1.PivotItems

If DateValue(pi.Value) = DateValue(Target.Value) Then
pf.CurrentPage = pi.Value


Exit For
End If
Next pi
Application.EnableEvents = True
End If

No obligation to answer all, at least 1 is another step closer.

Thanks!!!..........
Reply
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
Controlling Pivot Table Page-Field [email protected] Excel Discussion (Misc queries) 0 April 20th 07 03:02 AM
Pivot Table Page Field Area Broken GarethG Excel Discussion (Misc queries) 1 September 29th 05 10:11 PM
Pivot Table Page Field Neily Excel Discussion (Misc queries) 3 February 24th 05 01:23 PM
Pivot Table Page Field Jimbola Excel Discussion (Misc queries) 0 February 6th 05 09:13 PM
Pivot Table - Filtering Page Field R. G. Ingersoll Excel Discussion (Misc queries) 1 January 29th 05 07:29 PM


All times are GMT +1. The time now is 09:18 AM.

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

About Us

"It's about Microsoft Excel"