Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 408
Default PivotFields problem

Hi folks,

I use the following code to get the items of PivotFields("Managers"). It
works ok but not exactly what I am looking for. In the
PivotFields("Managers"), I hide some of the items which I dont want to show
on the list. Could anyone show me the way to exclude the hidden items? Any
help will be appreciated.

Thanks in advance.

Tim.

Sub Macro1()

Set nwSheet = Worksheets.Add
nwSheet.Activate

rw = 0
For Each pvtitem In Sheets("Sheet1").PivotTables("PivotTable1") _
.PivotFields("Managers").PivotItems
rw = rw + 1
nwSheet.Cells(rw, 1).Value = pvtitem.Name

Next

End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default PivotFields problem

Sub Macro1()

Set nwSheet = Worksheets.Add
nwSheet.Activate

rw = 0
For Each pvtitem In Sheets("Sheet1").PivotTables("PivotTable1") _
.PivotFields("Managers").PivotItems
if pvtItem.Visible then
rw = rw + 1
nwSheet.Cells(rw, 1).Value = pvtitem.Name
End if
Next

End Sub

--
Regards,
Tom Ogilvy

"Tim" wrote in message
...
Hi folks,

I use the following code to get the items of PivotFields("Managers"). It
works ok but not exactly what I am looking for. In the
PivotFields("Managers"), I hide some of the items which I don't want to

show
on the list. Could anyone show me the way to exclude the hidden items?

Any
help will be appreciated.

Thanks in advance.

Tim.

Sub Macro1()

Set nwSheet = Worksheets.Add
nwSheet.Activate

rw = 0
For Each pvtitem In Sheets("Sheet1").PivotTables("PivotTable1") _
.PivotFields("Managers").PivotItems
rw = rw + 1
nwSheet.Cells(rw, 1).Value = pvtitem.Name

Next

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
Tim Tim is offline
external usenet poster
 
Posts: 408
Default PivotFields problem

Hi Tom,

The code only give me one manager which is not right. For example, I have
nine managers. I hide 3 of them. I am expecting 6 manager on the new sheet.
Could you help me?

Thanks.

Tim.

"Tom Ogilvy" wrote:

Sub Macro1()

Set nwSheet = Worksheets.Add
nwSheet.Activate

rw = 0
For Each pvtitem In Sheets("Sheet1").PivotTables("PivotTable1") _
.PivotFields("Managers").PivotItems
if pvtItem.Visible then
rw = rw + 1
nwSheet.Cells(rw, 1).Value = pvtitem.Name
End if
Next

End Sub

--
Regards,
Tom Ogilvy

"Tim" wrote in message
...
Hi folks,

I use the following code to get the items of PivotFields("Managers"). It
works ok but not exactly what I am looking for. In the
PivotFields("Managers"), I hide some of the items which I don't want to

show
on the list. Could anyone show me the way to exclude the hidden items?

Any
help will be appreciated.

Thanks in advance.

Tim.

Sub Macro1()

Set nwSheet = Worksheets.Add
nwSheet.Activate

rw = 0
For Each pvtitem In Sheets("Sheet1").PivotTables("PivotTable1") _
.PivotFields("Managers").PivotItems
rw = rw + 1
nwSheet.Cells(rw, 1).Value = pvtitem.Name

Next

End Sub




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
PivotTable - PivotFields VBA Hutch Excel Discussion (Misc queries) 0 June 18th 08 09:03 PM
PivotFields Neal Excel Programming 2 September 20th 04 07:23 PM
Combining 2 Pivotfields to 1(Help!!!) Billabong Excel Programming 0 August 25th 04 10:18 AM
weird problem with PivotFields CurrentPage Chrysalis Excel Programming 0 April 22nd 04 01:51 AM
Pivotfields.CurrentPage Daniel Magnus Bennét Björck Excel Programming 5 February 6th 04 02:48 PM


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