PC Review


Reply
Thread Tools Rate Thread

cicle through pivot table

 
 
aek
Guest
Posts: n/a
 
      2nd Sep 2004
anyone knows how to cicle throught the different groups created by a pivot
table?
 
Reply With Quote
 
 
 
 
Debra Dalgleish
Guest
Posts: n/a
 
      2nd Sep 2004
If you want to do something in code with each pivot field, you can refer
to the pivotfields method. For example, the following code turns off the
subtotals for each field:

'=====================
Sub NoSubtotalsOrGrandTotals()
'turns off subtotals and grand totals
'.PivotFields could be changed to
'.RowFields or .ColumnFields
Dim pt As PivotTable
Dim pf As PivotField
On Error Resume Next
For Each pt In ActiveSheet.PivotTables
For Each pf In pt.PivotFields
'First, set index 1 (Automatic) to True,
'so all other values are set to False
pf.Subtotals(1) = True
pf.Subtotals(1) = False
Next pf
With pt
.ColumnGrand = False
.RowGrand = False
End With
Next pt

End Sub
'=======================

aek wrote:
> anyone knows how to cicle throught the different groups created by a pivot
> table?



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Child pivot table's source breaking from parent pivot table Michael Kucan Microsoft Excel Programming 0 1st Oct 2008 05:26 PM
Code that will rerun or refresh a pivot table (after new data ispasted into the original Pivot Table's Source Range) Mike C Microsoft Excel Programming 3 15th Feb 2008 06:22 AM
A red cicle with a line through junk e-mail folder.Is this normal? =?Utf-8?B?bHNtZnQ=?= Microsoft Outlook Discussion 1 28th May 2007 04:59 PM
how to create pivot table from existing pivot table in excel 2007 =?Utf-8?B?VWRheXJhaiBEaHVsZWthcg==?= Microsoft Excel Misc 1 15th Dec 2006 04:23 AM
Cicle through CommandBars ALESSANDRO Baraldi Microsoft Access VBA Modules 8 27th Feb 2004 06:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:54 PM.