Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Pivot Table Question: SubTotals for 2 of 4 Pivot Tables in same worksheet

I am trying to use the code below to put subtotals in 2 of 4 pivot
tables. Pivot Tables 1 and 3 have subtotals, and Tables 2 and 4 do
not. All 4 tables are in the same worksheet. The code creates
subtotals for Table 1, no subtotals for Table 2 (as desired), but when
the code processes Table 3, the subtotals for Table 1 get turned off.

Any advice to resolve this would be appreciated.

Thank you!

================================================

Public Sub GroupDates()

Select Case pt.Name
Case "Costs", "Revenues",
ShowSub = False
Case "Interest Only", "LoanAmount"
ShowSub = True
End Select

If ShowSub Then
Set rng = pt.PivotFields("ReportingDate").DataRange
MyArray = Array(False, False, False, False, True, True, True)
rng.Cells(1).Group Start:=True, End:=True, Periods:=MyArray
For Each pf In ActiveSheet.PivotTables(pt.name).RowFields
pf.Subtotals(1) = True
Next pf
End If

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
Distributing Pivot Tables where pivot table data can't be accessed Bendinblues Excel Discussion (Misc queries) 1 January 2nd 08 01:06 PM
Pivot Table Data Adding contents of two pivot tables and param que Roundy Excel Discussion (Misc queries) 0 July 2nd 07 10:20 PM
When refreshing pivot tables my pivot table chart type changes hannah220507 Excel Discussion (Misc queries) 1 May 22nd 07 02:57 PM
Subtotals in Pivot Tables Fred Smith Excel Worksheet Functions 3 February 23rd 07 02:19 AM
Pivot Tables -changing datasource for exsting Pivot Table kfschaefer Setting up and Configuration of Excel 0 May 30th 06 06:36 PM


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