Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hide Subtotals in Pivot Table for Certain Columns



I have a pivot table with the columns:


Vendor

Item

Description

Number of Stores with Item out of Stock

Quantity Required

Extended Cost

Model Stock

Order At



For each vendor I want to show the total order cost, however I do not
want subtotals on any of the other columns.


That is I need to know that I have to place an order for $1000 to a
vendor but it doesn't make sense to say 15 hammers plus 30 drills
equals 45.



I found the following macro which was very helpful however I want to
know if there is a way to be selective about which data fields should
be subtotaled and which should not

Sub NoSubtotals()
'turns off subtotals in pivot table
'.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
Next pt
End Sub


Sincerely

Jim P

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Hide Subtotals in Pivot Table for Certain Columns

I worked out one solution but perhaps someone can suggest a better way?

I used Data Filter Advanced and set up criteria to display only rows
where column B, or column C or Column D ... were *Total

Then I highlighted all values in columns other than the cost column,
selected visible cells only and changed the font to white on white.

This wasn't as automated as I had hoped it would be, however it
achieved the results that I wanted.

Jim P

Jim P wrote:
I have a pivot table with the columns:


Vendor

Item

Description

Number of Stores with Item out of Stock

Quantity Required

Extended Cost

Model Stock

Order At



For each vendor I want to show the total order cost, however I do not
want subtotals on any of the other columns.


That is I need to know that I have to place an order for $1000 to a
vendor but it doesn't make sense to say 15 hammers plus 30 drills
equals 45.



I found the following macro which was very helpful however I want to
know if there is a way to be selective about which data fields should
be subtotaled and which should not

Sub NoSubtotals()
'turns off subtotals in pivot table
'.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
Next pt
End Sub


Sincerely

Jim P


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
Pivot Table Hide Zero Subtotals - Excel 2007 jillybean Excel Worksheet Functions 4 March 9th 09 07:35 PM
add subtotals in columns in pivot table Help Eliminate Auto Theft Excel Discussion (Misc queries) 2 August 28th 08 09:51 PM
Excel Pivot Table: Hide Detail Columns and KEEP Totals? [email protected] Excel Discussion (Misc queries) 0 November 29th 07 08:51 PM
Hide subtotals of rowfields in a pivot table Huyeote[_2_] Excel Programming 3 April 22nd 04 04:46 AM
Pivot Table NewSheet Event Hide Columns Tysone Excel Programming 2 October 15th 03 01:51 AM


All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"