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 Page-Field

Controlling Pivot Table Page Field.

Thank you for looking at this query, I have tried the code, but there is an
error.



I have tried this code, but ran into run-time error:
"Unable to set the_Default Property of the Pivot Item class"

What I have done:
1.Cell C2: key in date (31/03/07 or 28/02/07)
2.Cell C2: use vlookup & indexmatch, it doesn't change the PivotField,
PageField.


---Taken from the community-------------------------------

Private Sub Worksheet_Change(ByVal Target As Range)
Dim pt As PivotTable
Dim pf As PivotField
Dim pi As PivotItem
Set pt = Worksheets("Sales Pivot").PivotTables(1)
Set pf = pt.PageFields("End-Mth")

If Target.Address = "$C$2" Then

Application.EnableEvents = False
For Each pi In pf.PivotItems
If LCase(pi.Value) = LCase(Target.Value) Then
pf.CurrentPage = pi.Value
Exit For
End If
Next pi
Application.EnableEvents = True

End If

End Sub




What I wanna do:
Cell C2: Use Reference formulas to change Pivot-PageField

Sheet 1: Data entry
Sheet 2: Central Control (this is where C2 is AND uses Vlookup & IndexMatch)
Sheet 3: Pivot Table (change according to sheet 1)



Thank you for the help.


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
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
I cannot drag a Pivot Table field into the page area KimboR Excel Discussion (Misc queries) 2 February 23rd 05 02:29 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 06:33 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"