Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Modify a calculated field formula depending upon selection of pagefield Tewari Excel Discussion (Misc queries) 0 April 10th 07 01:35 PM
Pivot Table PageField Todd Huttenstine Excel Programming 4 April 21st 04 09:46 PM
Finding the name of the pagefield clicked Tama Excel Programming 0 December 23rd 03 04:23 AM
How to find the current pagefield of a pivot table? Tama Excel Programming 0 December 22nd 03 05:00 AM
Members in a PageField Rickard Excel Programming 1 October 14th 03 03:08 PM


All times are GMT +1. The time now is 03:01 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"