Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
About PageField
Does anybody know how to get the item name in the
pagefields? It seems that the following expression doesn't work. ..PivotFields("[PageField Name]").PivotItems(i).Name where i=1,2,3,... Can someone give me some suggestions? Thanks! Best Wishes, Polly |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
About PageField
Hi Polly
Sub test() With ActiveSheet.PivotTables("PivotTable1") Dim i As Integer For i = 1 To .PageFields.Count MsgBox .PageFields(i) Next i End With End Sub -- XL2002 Regards William "Polly" wrote in message ... | Does anybody know how to get the item name in the | pagefields? It seems that the following expression | doesn't work. | | .PivotFields("[PageField Name]").PivotItems(i).Name | where i=1,2,3,... | | Can someone give me some suggestions? | | Thanks! | | Best Wishes, | Polly |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
About PageField
The following code will list the page field items on a new worksheet:
'============== Sub ListFields() 'lists all page field items on a new worksheet Dim ws As Worksheet Dim pt As PivotTable Dim pf As PivotField Dim pi As PivotItem Dim rw As Integer Set ws = Worksheets.Add ws.Activate Set pt = Worksheets("Pivot").PivotTables(1) rw = 0 For Each pf In pt.PageFields For Each pi In pf.PivotItems rw = rw + 1 ws.Cells(rw, 1).Value = pi.Name Next Next pf End Sub '===================== Polly wrote: Does anybody know how to get the item name in the pagefields? It seems that the following expression doesn't work. .PivotFields("[PageField Name]").PivotItems(i).Name where i=1,2,3,... Can someone give me some suggestions? Thanks! Best Wishes, Polly -- Debra Dalgleish Excel FAQ, Tips & Book List http://www.contextures.com/tiptech.html |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
About PageField
Hi Polly
I dont think my first post fully answered your question. Sub test() With ActiveSheet.PivotTables("PivotTable1") Dim i As Integer, ii As Integer For i = 1 To .PageFields.Count With .PageFields(i) For ii = 1 To .PivotItems.Count MsgBox .PivotItems(ii) Next ii End With Next i End With End Sub -- XL2002 Regards William "Polly" wrote in message ... | Does anybody know how to get the item name in the | pagefields? It seems that the following expression | doesn't work. | | .PivotFields("[PageField Name]").PivotItems(i).Name | where i=1,2,3,... | | Can someone give me some suggestions? | | Thanks! | | Best Wishes, | Polly |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
About PageField
Thanks for William's and Debra's reply.
I have tried both of your suggestions. However, your codes did not work in my pivot table. If I change "pagefields" to "rowfields" in the programs, they both worked! I mean it can show the details of row field. I have put a dimension in page field area and selected five items in the dimension. Does the program not work due to mulit-selection of items? Best Wishes, Polly -----Original Message----- Does anybody know how to get the item name in the pagefields? It seems that the following expression doesn't work. ..PivotFields("[PageField Name]").PivotItems(i).Name where i=1,2,3,... Can someone give me some suggestions? Thanks! Best Wishes, Polly . |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
About PageField
I am using OLAP cube to create the pivot table.
Will OLAP affect the result? Best Wishes, Polly -----Original Message----- Thanks for William's and Debra's reply. I have tried both of your suggestions. However, your codes did not work in my pivot table. If I change "pagefields" to "rowfields" in the programs, they both worked! I mean it can show the details of row field. I have put a dimension in page field area and selected five items in the dimension. Does the program not work due to mulit-selection of items? Best Wishes, Polly -----Original Message----- Does anybody know how to get the item name in the pagefields? It seems that the following expression doesn't work. ..PivotFields("[PageField Name]").PivotItems(i).Name where i=1,2,3,... Can someone give me some suggestions? Thanks! Best Wishes, Polly . . |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
About PageField
Try it and tell us.
-- Regards, Tom Ogilvy "Polly" wrote in message ... I am using OLAP cube to create the pivot table. Will OLAP affect the result? Best Wishes, Polly -----Original Message----- Thanks for William's and Debra's reply. I have tried both of your suggestions. However, your codes did not work in my pivot table. If I change "pagefields" to "rowfields" in the programs, they both worked! I mean it can show the details of row field. I have put a dimension in page field area and selected five items in the dimension. Does the program not work due to mulit-selection of items? Best Wishes, Polly -----Original Message----- Does anybody know how to get the item name in the pagefields? It seems that the following expression doesn't work. ..PivotFields("[PageField Name]").PivotItems(i).Name where i=1,2,3,... Can someone give me some suggestions? Thanks! Best Wishes, Polly . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Modify a calculated field formula depending upon selection of pagefield | Excel Discussion (Misc queries) | |||
Pivot Table PageField | Excel Programming | |||
Finding the name of the pagefield clicked | Excel Programming | |||
How to find the current pagefield of a pivot table? | Excel Programming | |||
Members in a PageField | Excel Programming |