Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Changing the CurrentPage items in a Pivot Table
Hello,
I have an already generated Pivot Table which i would like to amend the CurrentPageitems programmatically. I have a list of fields in a tab. I am able to select fields in this list that i would then like to build into my Pivot table as CurrentPage items. Using: For i = 1 To MyRange.Rows.Count If Len(Application.WorksheetFunction.Index(MyRange, i, 2)) 0 Then MySelection = Application.WorksheetFunction.Index(MyRange, i, 1) ActiveSheet.PivotTables("PivotTable1").PivotFields ("" & MySelection & "").CurrentPage = "(All)" End If Next I get the runtime error 1004 and the message "Unable to get the PivotFields Property of the Pivot Table Class". Guess what this comes down to is their is a much better way of doing this. Would anyone be able to help me with this please? Thanks John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot table - old items | Excel Discussion (Misc queries) | |||
Pivot Table Programming (Selecting Pivot Items) | Excel Programming | |||
Pivot Table Programing Help (Selecting Pivot Items) | Excel Programming | |||
PivotTable Pivot Fields CurrentPage | Excel Programming | |||
Changing a pivot table field items to current database | Excel Programming |