Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default 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
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 - old items Goodlighting Excel Discussion (Misc queries) 2 November 12th 08 08:26 PM
Pivot Table Programming (Selecting Pivot Items) Manish Jaitly[_2_] Excel Programming 0 May 30th 07 10:51 AM
Pivot Table Programing Help (Selecting Pivot Items) Manish Jaitly[_2_] Excel Programming 0 May 25th 07 12:38 PM
PivotTable Pivot Fields CurrentPage [email protected] Excel Programming 0 September 8th 05 06:01 PM
Changing a pivot table field items to current database Pete Straman Straman via OfficeKB.com Excel Programming 3 February 22nd 05 04:40 PM


All times are GMT +1. The time now is 12:22 PM.

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"