|
-
Jul 17th, 2003, 03:28 PM
#1
Thread Starter
New Member
pivot table pagefield
Hi,
I have a pivot table which stores data for each date on a separate page, ie the page field in the pivot table is the date. Now I want to increment the page fields through VBA. All I can find is a current page method. I cannot do it otherwise because my data keeps changing and I dont know what dates I got, so this has to be generically.
Any ideas,
thx
Sunil.
-
Jul 24th, 2003, 09:14 AM
#2
Addicted Member
Something like this :-
'-----------------------------------------
For Each Pi In ActiveSheet.PivotTables("PivotTable1"). _
PivotFields("Type").PivotItems
MsgBox (Pi)
Next
'-----------------------------------------
Regards
BrianB
-------------------------------
-
Jul 24th, 2003, 09:24 AM
#3
Addicted Member
Sorry, got distracted and didn't finish it off :-
'-----------------------------------------
Dim pt As PivotTable
Dim PF As PivotField
Set pt = ActiveSheet.PivotTables("PivotTable1")
Set PF = pt.PivotFields("Type")
'--------------------
For Each Pi In PF.PivotItems
PF.CurrentPage = Pi
MsgBox (Pi)
Next
'-----------------------------------------
Regards
BrianB
-------------------------------
-
Jul 24th, 2003, 12:45 PM
#4
Thread Starter
New Member
hmm, tried that earlier as well, but the code is giving me an error.
The error is "Unable to set the _default property of the pivotitem class".
I looked at the object browser for the _default class, its under hidden members. But the help for this didnt reveal much.
What do you think?
Thx for replying,
Sunil.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|