Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Remove all column and row fields from a pivot table

I know how to add a field (see below) to a pivot table, but from a
state where I don't know which columns and rows are added to the pivot
table, how can I "reset" the pivot table so I can add only the fields
I'm interested in?

Sheet1.PivotTables("PivotTable8").AddFields
RowFields:="Customer", _
ColumnFields:="CloseQuarter"
With Sheet22.PivotTables("PivotTable8").PivotFields("Sa les")
.Orientation = xlDataField
.Function = xlSum
.Position = 1
End With
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 140
Default Remove all column and row fields from a pivot table

Hi Takuto

This will remove all the items in your pivot table so you have a blank
table. Ready to populate with new information.

Take care

Marcus

Sub RemovePTItems()
'Removes all items in pivot table
Dim pt As PivotTable
Dim i As Integer

Set pt = ActiveSheet.PivotTables(1)
i = pt.PivotFields.Count

For Count = 1 To i
On Error Resume Next
pt.PivotFields(Count).Orientation = xlHidden
Next Count

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
remove add pivot table fields S Himmelrich Excel Programming 0 January 20th 09 03:46 PM
Looking to remove pivot fields from pivot table via macro S Himmelrich Excel Programming 0 January 16th 09 03:49 PM
Remove grouped items and fields from pivot table Tom Harwell Excel Discussion (Misc queries) 1 February 17th 08 10:06 PM
Pivot table: showing COLUMN summaries for some, not all, COLUMN fields. AndyCotgreave Excel Programming 0 October 2nd 07 11:18 AM
How to remove Drop Page Fields Here from Pivot Table wengyee Excel Discussion (Misc queries) 2 June 3rd 05 10:36 PM


All times are GMT +1. The time now is 12:42 PM.

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"